X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fstring.c;h=b30673c04599440e42d9ca76b902e174f59a2d0e;hb=31c546c4d0c3baf1b1e0ab292b4d096cffe64c34;hp=4d870ec9ac1a96f37776e5ba9e197122483a9c9a;hpb=4191cb150300d310ab5fa22ce2cfb02b6f6051b0;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/string.c b/src/src/string.c index 4d870ec9a..b30673c04 100644 --- a/src/src/string.c +++ b/src/src/string.c @@ -2,9 +2,10 @@ * Exim - an Internet mail transport agent * *************************************************/ +/* Copyright (c) The Exim Maintainers 2020 - 2022 */ /* Copyright (c) University of Cambridge 1995 - 2018 */ -/* Copyright (c) The Exim Maintainers 2020 - 2021 */ /* See the file NOTICE for conditions of use and distribution. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* Miscellaneous string-handling functions. Some are not required for utilities and tests, and are cut out by the COMPILE_UTILITY macro. */ @@ -1166,6 +1167,13 @@ if (!g) unsigned size = ((count + inc) & ~inc) + 1; /* round up requested count */ g = string_get_tainted(size, s); } +else if (!g->s) /* should not happen */ + { + g->s = string_copyn(s, count); + g->ptr = count; + g->size = count; /*XXX suboptimal*/ + return g; + } else if (is_incompatible(g->s, s)) { /* debug_printf("rebuf A\n"); */ @@ -1775,7 +1783,7 @@ while (fgets(CS buffer, sizeof(buffer), stdin) != NULL) int llflag = 0; int n = 0; int count; - int countset = 0; + BOOL countset = FASE; uschar format[256]; uschar outbuf[256]; uschar *s; @@ -1817,7 +1825,7 @@ while (fgets(CS buffer, sizeof(buffer), stdin) != NULL) else if (Ustrcmp(ss, "*") == 0) { args[n++] = (void *)(&count); - countset = 1; + countset = TRUE; } else