1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Make sure that only ascii is passed to isfoo functions.

This commit is contained in:
Werner Koch 2003-06-07 20:06:32 +00:00
parent a72b1e0a57
commit 6a00a17bd1
15 changed files with 66 additions and 31 deletions

View file

@ -1,3 +1,7 @@
2003-06-07 Werner Koch <wk@gnupg.org>
* util.h (hexdigitp,spacep,digitp): New.
2003-05-21 David Shaw <dshaw@jabberwocky.com>
* cipher.h, i18n.h, iobuf.h, memory.h, mpi.h, types.h, util.h:

View file

@ -260,6 +260,13 @@ int vasprintf ( char **result, const char *format, va_list args);
#define wipememory2(_ptr,_set,_len) do { volatile char *_vptr=(volatile char *)(_ptr); size_t _vlen=(_len); while(_vlen) { *_vptr=(_set); _vptr++; _vlen--; } } while(0)
#define wipememory(_ptr,_len) wipememory2(_ptr,0,_len)
/*-- macros to replace ctype ones and avoid locale problems --*/
#define spacep(p) (*(p) == ' ' || *(p) == '\t')
#define digitp(p) (*(p) >= '0' && *(p) <= '9')
#define hexdigitp(a) (digitp (a) \
|| (*(a) >= 'A' && *(a) <= 'F') \
|| (*(a) >= 'a' && *(a) <= 'f'))
/******* RISC OS stuff ***********/
#ifdef __riscos__
/* needed for strcasecmp() */