X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Flookups%2Flf_quote.c;h=2a76756e9cf417c2febeec6456424ae2fc12488a;hb=4c0a7a9cb02f9904c2e890f77ff8ce3a6beb25f4;hp=d2188a33f593baf5a4832922e7ca8d50176ca6d4;hpb=0a49a7a4f1090b6f1ce1d0f9d969804c9226b53e;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/lookups/lf_quote.c b/src/src/lookups/lf_quote.c index d2188a33f..2a76756e9 100644 --- a/src/src/lookups/lf_quote.c +++ b/src/src/lookups/lf_quote.c @@ -1,5 +1,3 @@ -/* $Cambridge: exim/src/src/lookups/lf_quote.c,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */ - /************************************************* * Exim - an Internet mail transport agent * *************************************************/ @@ -39,7 +37,11 @@ result = string_append(result, asize, aoffset, 2, name, US"="); /* NULL is handled as an empty string */ -if (value == NULL) value = US""; +if (!value) + { + value = US""; + vlength = 0; + } /* Quote the value if it is empty, contains white space, or starts with a quote character. */ @@ -47,21 +49,19 @@ character. */ if (value[0] == 0 || Ustrpbrk(value, " \t\n\r") != NULL || value[0] == '\"') { int j; - result = string_cat(result, asize, aoffset, US"\"", 1); + result = string_catn(result, asize, aoffset, US"\"", 1); for (j = 0; j < vlength; j++) { if (value[j] == '\"' || value[j] == '\\') - result = string_cat(result, asize, aoffset, US"\\", 1); - result = string_cat(result, asize, aoffset, US value+j, 1); + result = string_catn(result, asize, aoffset, US"\\", 1); + result = string_catn(result, asize, aoffset, US value+j, 1); } - result = string_cat(result, asize, aoffset, US"\"", 1); + result = string_catn(result, asize, aoffset, US"\"", 1); } else - { - result = string_cat(result, asize, aoffset, US value, vlength); - } + result = string_catn(result, asize, aoffset, US value, vlength); -return string_cat(result, asize, aoffset, US" ", 1); +return string_catn(result, asize, aoffset, US" ", 1); } /* End of lf_quote.c */