X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fstring.c;h=e169a9f057076ff42995949f7b87f76ee2f9eff6;hb=5a886ce7f82d5add6fdbf17a6ed698f13abb748d;hp=76e47f4184a061d71a2e8f1ad3b390348735319f;hpb=55414b25bee9f0195ccd1e47f3d3b5cba766e099;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/string.c b/src/src/string.c index 76e47f418..e169a9f05 100644 --- a/src/src/string.c +++ b/src/src/string.c @@ -1013,12 +1013,17 @@ return new; static const uschar * Ustrnchr(const uschar * s, int c, unsigned * len) { -while (*len) +unsigned siz = *len; +while (siz) { if (!*s) return NULL; - if (*s == c) return s; + if (*s == c) + { + *len = siz; + return s; + } s++; - *len--; + siz--; } return NULL; }