about summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-05-02 21:17:19 -0400
committerRich Felker <dalias@aerifal.cx>2015-05-02 21:19:08 -0400
commitd0040e239e8d3048a7fb38f0bacaad4838fac605 (patch)
tree06073a41aeaf4c09a24efb9d6829e58379ef61ca /include
parent7fe273b2c163e4594221375120c6ce209a783262 (diff)
downloadmusl-d0040e239e8d3048a7fb38f0bacaad4838fac605.tar.gz
musl-d0040e239e8d3048a7fb38f0bacaad4838fac605.tar.xz
musl-d0040e239e8d3048a7fb38f0bacaad4838fac605.zip
improve iswdigit macro to diagnose errors
this is analogous to commit 2ca55a93f2a11185d72dcb69006fd2c30b5c3144
for the macros in ctype.h.
Diffstat (limited to 'include')
-rw-r--r--include/wchar.h2
-rw-r--r--include/wctype.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/wchar.h b/include/wchar.h
index ad727a86..0167dce6 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -175,7 +175,7 @@ wctype_t  wctype(const char *);
 
 #ifndef __cplusplus
 #undef iswdigit
-#define iswdigit(a) ((unsigned)(a)-'0' < 10)
+#define iswdigit(a) (0 ? iswdigit(a) : ((unsigned)(a)-'0') < 10)
 #endif
 #endif
 
diff --git a/include/wctype.h b/include/wctype.h
index 3da12195..bc2420d3 100644
--- a/include/wctype.h
+++ b/include/wctype.h
@@ -45,7 +45,7 @@ wctype_t  wctype(const char *);
 
 #ifndef __cplusplus
 #undef iswdigit
-#define iswdigit(a) (((unsigned)(a)-L'0') < 10)
+#define iswdigit(a) (0 ? iswdigit(a) : ((unsigned)(a)-'0') < 10)
 #endif
 
 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \