X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/1688f43b3071b3b4d7d3a88a6ccf28c1bc3272e0..184e88237dea64ce48076cdd0184612d057cbafd:/src/src/string.c?ds=sidebyside diff --git a/src/src/string.c b/src/src/string.c index 2fe57b303..c0a8805fe 100644 --- a/src/src/string.c +++ b/src/src/string.c @@ -1,10 +1,10 @@ -/* $Cambridge: exim/src/src/string.c,v 1.9 2006/02/13 11:13:37 ph10 Exp $ */ +/* $Cambridge: exim/src/src/string.c,v 1.11 2007/01/08 10:50:18 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2006 */ +/* Copyright (c) University of Cambridge 1995 - 2007 */ /* See the file NOTICE for conditions of use and distribution. */ /* Miscellaneous string-handling functions. Some are not required for @@ -1472,8 +1472,10 @@ printf("Testing string_format\n"); while (fgets(CS buffer, sizeof(buffer), stdin) != NULL) { void *args[3]; + long long llargs[3]; double dargs[3]; int dflag = 0; + int llflag = 0; int n = 0; int count; int countset = 0; @@ -1504,6 +1506,11 @@ while (fgets(CS buffer, sizeof(buffer), stdin) != NULL) dflag = 1; dargs[n++] = Ustrtod(outbuf, NULL); } + else if (Ustrstr(outbuf, "ll") != NULL) + { + llflag = 1; + llargs[n++] = strtoull(CS outbuf, NULL, 10); + } else { args[n++] = (void *)Uatoi(outbuf); @@ -1526,11 +1533,16 @@ while (fgets(CS buffer, sizeof(buffer), stdin) != NULL) if (*s == ',') s++; } - if (!dflag) printf("%s\n", string_format(outbuf, sizeof(outbuf), CS format, - args[0], args[1], args[2])? "True" : "False"); + if (!dflag && !llflag) + printf("%s\n", string_format(outbuf, sizeof(outbuf), CS format, + args[0], args[1], args[2])? "True" : "False"); + + else if (dflag) + printf("%s\n", string_format(outbuf, sizeof(outbuf), CS format, + dargs[0], dargs[1], dargs[2])? "True" : "False"); else printf("%s\n", string_format(outbuf, sizeof(outbuf), CS format, - dargs[0], dargs[1], dargs[2])? "True" : "False"); + llargs[0], llargs[1], llargs[2])? "True" : "False"); printf("%s\n", CS outbuf); if (countset) printf("count=%d\n", count);