X-Git-Url: https://git.distorted.org.uk/~mdw/mLib/blobdiff_plain/776d2da28318443431563b68c2807eb0c29c49fa..3618811496a6d131fd4bffa19e262c521d39e819:/utils/str.c diff --git a/utils/str.c b/utils/str.c index 51ca323..e759828 100644 --- a/utils/str.c +++ b/utils/str.c @@ -32,6 +32,7 @@ #include #include +#include "macros.h" #include "str.h" /*----- Main code ---------------------------------------------------------*/ @@ -58,7 +59,7 @@ char *str_qword(char **pp, unsigned f) if (!p) return (0); - while (isspace((unsigned char)*p)) + while (ISSPACE(*p)) p++; if (!*p) { *pp = 0; @@ -83,8 +84,8 @@ char *str_qword(char **pp, unsigned f) *qq++ = *q; break; default: - if (isspace((unsigned char)*q)) { - do q++; while (*q && isspace((unsigned char)*q)); + if (ISSPACE(*q)) { + do q++; while (*q && ISSPACE(*q)); goto done; } else if (!(f & STRF_QUOTE)) goto stdchar; @@ -312,7 +313,7 @@ void str_sanitize(char *d, const char *p, size_t sz) sz--; while (*p && sz) { int ch = *p++; - if (!isgraph((unsigned char)ch)) + if (!ISGRAPH(ch)) ch = '_'; *d++ = ch; sz--;