summaryrefslogtreecommitdiffstats
path: root/common/util.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2001-12-14 14:43:42 +0100
committerWerner Koch <wk@gnupg.org>2001-12-14 14:43:42 +0100
commit7606e3b33a57016b39b02857a7094e378a245ec3 (patch)
treeefbf689db541926ab5a8683e2c39a4e4793e93d4 /common/util.h
parent* util.h (digitp, hexdigitp): New ctype like macros. (diff)
downloadgnupg2-7606e3b33a57016b39b02857a7094e378a245ec3.tar.xz
gnupg2-7606e3b33a57016b39b02857a7094e378a245ec3.zip
* util.h (digitp, hexdigitp): New ctype like macros.
(atoi_1,atoi_2,atoi_4,xtoi_1,xtoi_2): New. * command.c: Removed the conversion macros as they are now in ../common/util.h.
Diffstat (limited to 'common/util.h')
-rw-r--r--common/util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/util.h b/common/util.h
index e30923330..35529253a 100644
--- a/common/util.h
+++ b/common/util.h
@@ -58,8 +58,8 @@ int map_assuan_err (int err);
/* some macros to replace ctype ones and avoid locale problems */
#define digitp(p) (*(p) >= '0' && *(p) <= '9')
#define hexdigitp(a) (digitp (a) \
- || ((a) >= 'A' && (a) <= 'F') \
- || ((a) >= 'a' && (a) <= 'f'))
+ || (*(a) >= 'A' && *(a) <= 'F') \
+ || (*(a) >= 'a' && *(a) <= 'f'))
/* the atoi macros assume that the buffer has only valid digits */
#define atoi_1(p) (*(p) - '0' )
#define atoi_2(p) ((atoi_1(p) * 10) + atoi_1((p)+1))