summaryrefslogtreecommitdiffstats
path: root/apps/apps.h
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-02-14 13:02:15 +0100
committerRichard Levitte <levitte@openssl.org>2016-02-14 19:31:55 +0100
commit18295f0c2db084fe00d935d8506d6e964f652d21 (patch)
tree81e661fc1e2052c698b5daee8aae711e574bc0e4 /apps/apps.h
parentef8ca6bd544e4baea67f9a193ae896b8629944d0 (diff)
Make sure to use unsigned char for is*() functions
On some platforms, the implementation is such that a signed char triggers a warning when used with is*() functions. On others, the behavior is outright buggy when presented with a char that happens to get promoted to a negative integer. The safest thing is to cast the char that's used to an unsigned char. Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'apps/apps.h')
-rw-r--r--apps/apps.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/apps.h b/apps/apps.h
index 8ac7c03891..878dc11c07 100644
--- a/apps/apps.h
+++ b/apps/apps.h
@@ -149,6 +149,13 @@ int opt_umax(const char *value, uintmax_t *result);
# define uintmax_t unsigned long
# endif
+/*
+ * quick macro when you need to pass an unsigned char instead of a char.
+ * this is true for some implementations of the is*() functions, for
+ * example.
+ */
+#define _UC(c) ((unsigned char)(c))
+
int app_RAND_load_file(const char *file, int dont_warn);
int app_RAND_write_file(const char *file);
/*