X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fstring.c;h=5e48b445cd27fd3d0a314fc46b9822529e95aa0a;hb=de6f74f297d040a34746bc8e1829ad4b867441c9;hp=2441f9b17a4c66df5783b166bf96f814556845c4;hpb=b72f857fb5b9bfe800daf6d08da85f4bff81ce1d;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/string.c b/src/src/string.c index 2441f9b17..5e48b445c 100644 --- a/src/src/string.c +++ b/src/src/string.c @@ -905,7 +905,7 @@ int sep = *separator; const uschar *s = *listptr; BOOL sep_is_special; -if (s == NULL) return NULL; +if (!s) return NULL; /* This allows for a fixed specified separator to be an iscntrl() character, but at the time of implementation, this is never the case. However, it's best @@ -925,15 +925,13 @@ if (sep <= 0) while (isspace(*s) && *s != sep) s++; } else - { - sep = (sep == 0)? ':' : -sep; - } + sep = sep ? -sep : ':'; *separator = sep; } /* An empty string has no list elements */ -if (*s == 0) return NULL; +if (!*s) return NULL; /* Note whether whether or not the separator is an iscntrl() character. */ @@ -944,13 +942,13 @@ sep_is_special = iscntrl(sep); if (buffer) { int p = 0; - for (; *s != 0; s++) + for (; *s; s++) { if (*s == sep && (*(++s) != sep || sep_is_special)) break; if (p < buflen - 1) buffer[p++] = *s; } while (p > 0 && isspace(buffer[p-1])) p--; - buffer[p] = 0; + buffer[p] = '\0'; } /* Handle the case when a buffer is not provided. */ @@ -980,10 +978,10 @@ else for (;;) { - for (ss = s + 1; *ss != 0 && *ss != sep; ss++) ; + for (ss = s + 1; *ss && *ss != sep; ss++) ; g = string_catn(g, s, ss-s); s = ss; - if (*s == 0 || *(++s) != sep || sep_is_special) break; + if (!*s || *++s != sep || sep_is_special) break; } while (g->ptr > 0 && isspace(g->s[g->ptr-1])) g->ptr--; buffer = string_from_gstring(g);