X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/9f4001740f061f29c65835c6f7efcab50c27db13..a85c067ba6c6940512cf57ec213277a370d87e70:/src/src/lookups/nisplus.c diff --git a/src/src/lookups/nisplus.c b/src/src/lookups/nisplus.c index 0dff480f5..78c79563f 100644 --- a/src/src/lookups/nisplus.c +++ b/src/src/lookups/nisplus.c @@ -2,8 +2,10 @@ * Exim - an Internet mail transport agent * *************************************************/ +/* Copyright (c) The Exim Maintainers 2020 - 2022 */ /* Copyright (c) University of Cambridge 1995 - 2018 */ /* See the file NOTICE for conditions of use and distribution. */ +/* SPDX-License-Identifier: GPL-2.0-only */ #include "../exim.h" #include "lf_functions.h" @@ -225,25 +227,24 @@ characters. No options are recognized. Arguments: s the string to be quoted opt additional option text or NULL if none + idx lookup type index Returns: the processed string or NULL for a bad option */ static uschar * -nisplus_quote(uschar *s, uschar *opt) +nisplus_quote(uschar * s, uschar * opt, unsigned idx) { int count = 0; -uschar *quoted; -uschar *t = s; +uschar * quoted, * t = s; -if (opt != NULL) return NULL; /* No options recognized */ +if (opt) return NULL; /* No options recognized */ -while (*t != 0) if (*t++ == '\"') count++; -if (count == 0) return s; +while (*t) if (*t++ == '\"') count++; -t = quoted = store_get(Ustrlen(s) + count + 1, is_tainted(s)); +t = quoted = store_get_quoted(Ustrlen(s) + count + 1, s, idx); -while (*s != 0) +while (*s) { *t++ = *s; if (*s++ == '\"') *t++ = '\"'; @@ -262,12 +263,13 @@ return quoted; #include "../version.h" -void -nisplus_version_report(FILE *f) +gstring * +nisplus_version_report(gstring * g) { #ifdef DYNLOOKUP -fprintf(f, "Library version: NIS+: Exim version %s\n", EXIM_VERSION_STR); +g = string_fmt_append(g, "Library version: NIS+: Exim version %s\n", EXIM_VERSION_STR); #endif +return g; }