From: mickey Date: Thu, 12 Dec 1996 08:16:30 +0000 (+0000) Subject: safe to{lower,upper} macros. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c4df156f2d8108aeb552ba8e774dba136d99dcda;p=openbsd safe to{lower,upper} macros. --- diff --git a/sys/lib/libsa/stand.h b/sys/lib/libsa/stand.h index f81be0701d8..310b6b2f9bb 100644 --- a/sys/lib/libsa/stand.h +++ b/sys/lib/libsa/stand.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stand.h,v 1.15 1996/12/08 15:15:57 niklas Exp $ */ +/* $OpenBSD: stand.h,v 1.16 1996/12/12 08:16:30 mickey Exp $ */ /* $NetBSD: stand.h,v 1.18 1996/11/30 04:35:51 gwr Exp $ */ /*- @@ -128,9 +128,9 @@ extern struct open_file files[]; #define isupper(c) ((c) >= 'A' && (c) <= 'Z') #define islower(c) ((c) >= 'a' && (c) <= 'z') -#define isalpha(c) (isupper(c)||islower(c)) -#define tolower(c) ((c) - 'A' + 'a') -#define toupper(c) ((c) - 'a' + 'A') +#define isalpha(c) (isupper(c)||islower(c)) +#define tolower(c) (isupper(c)?((c) - 'A' + 'a'):(c)) +#define toupper(c) (islower(c)?((c) - 'a' + 'A'):(c)) #define isspace(c) ((c) == ' ' || (c) == '\t') #define isdigit(c) ((c) >= '0' && (c) <= '9')