diff options
author | David Shaw <[email protected]> | 2003-07-10 12:26:42 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2003-07-10 12:26:42 +0000 |
commit | 654276143b4096f630cffb2010a08a60bd01c6b8 (patch) | |
tree | 5aa42063fd4299385ab70740580438c5049469d9 /util/miscutil.c | |
parent | * types.h: Prefer using uint64_t when creating a 64-bit unsigned type. (diff) | |
download | gnupg-654276143b4096f630cffb2010a08a60bd01c6b8.tar.gz gnupg-654276143b4096f630cffb2010a08a60bd01c6b8.zip |
* iobuf.c (check_special_filename): Replaced is isdigit by digitp
to avoid passing negative values and potential locale problems.
Problem noted by Christian Biere.
* strgutil.c (strlwr,strcasecmp,strncasecmp): Make sure we don't
pass a negative value.
* miscutil.c (scan_isodatestr): Ditto.
Diffstat (limited to '')
-rw-r--r-- | util/miscutil.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/miscutil.c b/util/miscutil.c index 42b2b3a88..b266d27d4 100644 --- a/util/miscutil.c +++ b/util/miscutil.c @@ -1,5 +1,5 @@ /* miscutil.c - miscellaneous utilities - * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -56,11 +56,11 @@ scan_isodatestr( const char *string ) if( strlen(string) != 10 || string[4] != '-' || string[7] != '-' ) return 0; for( i=0; i < 4; i++ ) - if( !isdigit(string[i]) ) + if( !digitp(string+i) ) return 0; - if( !isdigit(string[5]) || !isdigit(string[6]) ) + if( !digitp(string+5) || !digitp(string+6) ) return 0; - if( !isdigit(string[8]) || !isdigit(string[9]) ) + if( !digitp(string+8) || !digitp(string+9) ) return 0; year = atoi(string); month = atoi(string+5); |