diff options
author | gad <gad@FreeBSD.org> | 2004-06-02 00:14:28 +0000 |
---|---|---|
committer | gad <gad@FreeBSD.org> | 2004-06-02 00:14:28 +0000 |
commit | 4f0e537c28e63712270d1fc2aff09f1313e6497d (patch) | |
tree | cbf6f88e45c31567b402d78e51e698ce9a2be13b /usr.sbin/newsyslog | |
parent | d731f360fab7c78caec572a49149caa7361869f2 (diff) | |
download | FreeBSD-src-4f0e537c28e63712270d1fc2aff09f1313e6497d.zip FreeBSD-src-4f0e537c28e63712270d1fc2aff09f1313e6497d.tar.gz |
Improved versions of the is*ch() and tolowerch() macros that I like to use.
Diffstat (limited to 'usr.sbin/newsyslog')
-rw-r--r-- | usr.sbin/newsyslog/newsyslog.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c index 2574a31..88c75d2 100644 --- a/usr.sbin/newsyslog/newsyslog.c +++ b/usr.sbin/newsyslog/newsyslog.c @@ -155,14 +155,14 @@ static void createdir(const struct conf_entry *ent, char *dirpart); static void createlog(const struct conf_entry *ent); /* - * All the following are defined to work on an 'int', in the - * range 0 to 255, plus EOF. Define wrappers which can take - * values of type 'char', either signed or unsigned. + * All the following take a parameter of 'int', but expect values in the + * range of unsigned char. Define wrappers which take values of type 'char', + * whether signed or unsigned, and ensure they end up in the right range. */ -#define isdigitch(Anychar) isdigit(((int) Anychar) & 255) -#define isprintch(Anychar) isprint(((int) Anychar) & 255) -#define isspacech(Anychar) isspace(((int) Anychar) & 255) -#define tolowerch(Anychar) tolower(((int) Anychar) & 255) +#define isdigitch(Anychar) isdigit((u_char)(Anychar)) +#define isprintch(Anychar) isprint((u_char)(Anychar)) +#define isspacech(Anychar) isspace((u_char)(Anychar)) +#define tolowerch(Anychar) tolower((u_char)(Anychar)) int main(int argc, char **argv) |