Mercurial > hg > octave-lyh > gnulib-hg
changeset 5924:7e72ef843d73
(__option_is_short): Check upper limit of __key.
Isprint() requires its argument to have the value of an
unsigned char or EOF.
author | Sergey Poznyakoff <gray@gnu.org.ua> |
---|---|
date | Thu, 16 Jun 2005 11:52:34 +0000 |
parents | 280b8d19043c |
children | 38851977f22c |
files | lib/argp.h |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/argp.h +++ b/lib/argp.h @@ -23,6 +23,7 @@ #include <stdio.h> #include <ctype.h> #include <getopt.h> +#include <limits.h> #define __need_error_t #include <errno.h> @@ -579,7 +580,7 @@ else { int __key = __opt->key; - return __key > 0 && isprint (__key); + return __key > 0 && __key <= UCHAR_MAX && isprint (__key); } }