summaryrefslogtreecommitdiff
path: root/src/tool_urlglob.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-11-22 09:01:24 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-11-23 08:26:51 +0100
commitdcd6f810255785d52b89150e18460fb0899d4f7e (patch)
treec3cb7cdcb79dbf752edcd997934e44a2e9998397 /src/tool_urlglob.c
parent9944d6ba334f07b0b6199bdb5bb82091c88c16ed (diff)
downloadcurl-dcd6f810255785d52b89150e18460fb0899d4f7e.tar.gz
snprintf: renamed and we now only use msnprintf()
The function does not return the same value as snprintf() normally does, so readers may be mislead into thinking the code works differently than it actually does. A different function name makes this easier to detect. Reported-by: Tomas Hoger Assisted-by: Daniel Gustafsson Fixes #3296 Closes #3297
Diffstat (limited to 'src/tool_urlglob.c')
-rw-r--r--src/tool_urlglob.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c
index e4a5c33db..babae0416 100644
--- a/src/tool_urlglob.c
+++ b/src/tool_urlglob.c
@@ -462,9 +462,9 @@ CURLcode glob_url(URLGlob **glob, char *url, unsigned long *urlnum,
char text[512];
const char *t;
if(glob_expand->pos) {
- snprintf(text, sizeof(text), "%s in URL position %zu:\n%s\n%*s^",
- glob_expand->error,
- glob_expand->pos, url, glob_expand->pos - 1, " ");
+ msnprintf(text, sizeof(text), "%s in URL position %zu:\n%s\n%*s^",
+ glob_expand->error,
+ glob_expand->pos, url, glob_expand->pos - 1, " ");
t = text;
}
else
@@ -563,8 +563,8 @@ CURLcode glob_next_url(char **globbed, URLGlob *glob)
switch(pat->type) {
case UPTSet:
if(pat->content.Set.elements) {
- snprintf(buf, buflen, "%s",
- pat->content.Set.elements[pat->content.Set.ptr_s]);
+ msnprintf(buf, buflen, "%s",
+ pat->content.Set.elements[pat->content.Set.ptr_s]);
len = strlen(buf);
buf += len;
buflen -= len;
@@ -578,9 +578,9 @@ CURLcode glob_next_url(char **globbed, URLGlob *glob)
}
break;
case UPTNumRange:
- snprintf(buf, buflen, "%0*lu",
- pat->content.NumRange.padlength,
- pat->content.NumRange.ptr_n);
+ msnprintf(buf, buflen, "%0*lu",
+ pat->content.NumRange.padlength,
+ pat->content.NumRange.ptr_n);
len = strlen(buf);
buf += len;
buflen -= len;
@@ -653,9 +653,9 @@ CURLcode glob_match_url(char **result, char *filename, URLGlob *glob)
appendlen = 1;
break;
case UPTNumRange:
- snprintf(numbuf, sizeof(numbuf), "%0*lu",
- pat->content.NumRange.padlength,
- pat->content.NumRange.ptr_n);
+ msnprintf(numbuf, sizeof(numbuf), "%0*lu",
+ pat->content.NumRange.padlength,
+ pat->content.NumRange.ptr_n);
appendthis = numbuf;
appendlen = strlen(numbuf);
break;