fix print formatting string directives
This commit is contained in:
parent
c0f3e32447
commit
3dcd2b82c4
3
CHANGES
3
CHANGES
@ -6,6 +6,9 @@
|
|||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
|
|
||||||
|
Yang Tse (4 Sep 2008)
|
||||||
|
- Several fixes related with print formatting string directives.
|
||||||
|
|
||||||
Daniel Fandrich (3 Sep 2008)
|
Daniel Fandrich (3 Sep 2008)
|
||||||
- Search for the FreeBSD CA cert file /usr/local/share/certs/ca-root.crt
|
- Search for the FreeBSD CA cert file /usr/local/share/certs/ca-root.crt
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ int main(int argc, argv_item_t argv[], char **envp)
|
|||||||
data = (unsigned char *)suck(&dataLen);
|
data = (unsigned char *)suck(&dataLen);
|
||||||
base64Len = Curl_base64_encode(handle, data, dataLen, &base64);
|
base64Len = Curl_base64_encode(handle, data, dataLen, &base64);
|
||||||
|
|
||||||
fprintf(stderr, "%d\n", base64Len);
|
fprintf(stderr, "%zu\n", base64Len);
|
||||||
fprintf(stdout, "%s\n", base64);
|
fprintf(stdout, "%s\n", base64);
|
||||||
|
|
||||||
free(base64); free(data);
|
free(base64); free(data);
|
||||||
|
@ -293,7 +293,7 @@ CURLcode Curl_output_digest(struct connectdata *conn,
|
|||||||
if(!d->cnonce) {
|
if(!d->cnonce) {
|
||||||
/* Generate a cnonce */
|
/* Generate a cnonce */
|
||||||
now = Curl_tvnow();
|
now = Curl_tvnow();
|
||||||
snprintf(cnoncebuf, sizeof(cnoncebuf), "%06ld", now.tv_sec);
|
snprintf(cnoncebuf, sizeof(cnoncebuf), "%06ld", (long)now.tv_sec);
|
||||||
if(Curl_base64_encode(data, cnoncebuf, strlen(cnoncebuf), &cnonce))
|
if(Curl_base64_encode(data, cnoncebuf, strlen(cnoncebuf), &cnonce))
|
||||||
d->cnonce = cnonce;
|
d->cnonce = cnonce;
|
||||||
else
|
else
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -167,7 +167,7 @@ void *curl_docalloc(size_t wanted_elements, size_t wanted_size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(logfile && source)
|
if(logfile && source)
|
||||||
fprintf(logfile, "MEM %s:%d calloc(%u,%u) = %p\n",
|
fprintf(logfile, "MEM %s:%d calloc(%zu,%zu) = %p\n",
|
||||||
source, line, wanted_elements, wanted_size, mem ? mem->mem : 0);
|
source, line, wanted_elements, wanted_size, mem ? mem->mem : 0);
|
||||||
return (mem ? mem->mem : NULL);
|
return (mem ? mem->mem : NULL);
|
||||||
}
|
}
|
||||||
@ -189,7 +189,7 @@ char *curl_dostrdup(const char *str, int line, const char *source)
|
|||||||
memcpy(mem, str, len);
|
memcpy(mem, str, len);
|
||||||
|
|
||||||
if(logfile)
|
if(logfile)
|
||||||
fprintf(logfile, "MEM %s:%d strdup(%p) (%zd) = %p\n",
|
fprintf(logfile, "MEM %s:%d strdup(%p) (%zu) = %p\n",
|
||||||
source, line, str, len, mem);
|
source, line, str, len, mem);
|
||||||
|
|
||||||
return mem;
|
return mem;
|
||||||
@ -212,7 +212,7 @@ void *curl_dorealloc(void *ptr, size_t wantedsize,
|
|||||||
|
|
||||||
mem=(struct memdebug *)(Curl_crealloc)(mem, size);
|
mem=(struct memdebug *)(Curl_crealloc)(mem, size);
|
||||||
if(logfile)
|
if(logfile)
|
||||||
fprintf(logfile, "MEM %s:%d realloc(%p, %zd) = %p\n",
|
fprintf(logfile, "MEM %s:%d realloc(%p, %zu) = %p\n",
|
||||||
source, line, ptr, wantedsize, mem?mem->mem:NULL);
|
source, line, ptr, wantedsize, mem?mem->mem:NULL);
|
||||||
|
|
||||||
if(mem) {
|
if(mem) {
|
||||||
|
@ -1096,7 +1096,7 @@ CURLcode Curl_nss_connect(struct connectdata *conn, int sockindex)
|
|||||||
n = strrchr(data->set.str[STRING_CERT], '/');
|
n = strrchr(data->set.str[STRING_CERT], '/');
|
||||||
if(n) {
|
if(n) {
|
||||||
n++; /* skip last slash */
|
n++; /* skip last slash */
|
||||||
snprintf(nickname, PATH_MAX, "PEM Token #%ld:%s", 1, n);
|
snprintf(nickname, PATH_MAX, "PEM Token #%d:%s", 1, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1164,7 +1164,7 @@ CURLcode Curl_nss_connect(struct connectdata *conn, int sockindex)
|
|||||||
n = strrchr(data->set.str[STRING_SSL_ISSUERCERT], '/');
|
n = strrchr(data->set.str[STRING_SSL_ISSUERCERT], '/');
|
||||||
if (n) {
|
if (n) {
|
||||||
n++; /* skip last slash */
|
n++; /* skip last slash */
|
||||||
snprintf(nickname, PATH_MAX, "PEM Token #%ld:%s", 1, n);
|
snprintf(nickname, PATH_MAX, "PEM Token #%d:%s", 1, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 2004 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -720,7 +720,7 @@ const char *Curl_idn_strerror (struct connectdata *conn, int err)
|
|||||||
str = "dlopen() error";
|
str = "dlopen() error";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
snprintf(buf, max, "error %d", (int)err);
|
snprintf(buf, max, "error %d", err);
|
||||||
str = NULL;
|
str = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -411,7 +411,7 @@ CURLcode Curl_close(struct SessionHandle *data)
|
|||||||
if(data == (struct SessionHandle *) curr->ptr) {
|
if(data == (struct SessionHandle *) curr->ptr) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"MAJOR problem we %p are still in send pipe for %p done %d\n",
|
"MAJOR problem we %p are still in send pipe for %p done %d\n",
|
||||||
data, connptr, connptr->bits.done);
|
data, connptr, (int)connptr->bits.done);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -421,7 +421,7 @@ CURLcode Curl_close(struct SessionHandle *data)
|
|||||||
if(data == (struct SessionHandle *) curr->ptr) {
|
if(data == (struct SessionHandle *) curr->ptr) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"MAJOR problem we %p are still in recv pipe for %p done %d\n",
|
"MAJOR problem we %p are still in recv pipe for %p done %d\n",
|
||||||
data, connptr, connptr->bits.done);
|
data, connptr, (int)connptr->bits.done);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -431,7 +431,7 @@ CURLcode Curl_close(struct SessionHandle *data)
|
|||||||
if(data == (struct SessionHandle *) curr->ptr) {
|
if(data == (struct SessionHandle *) curr->ptr) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"MAJOR problem we %p are still in pend pipe for %p done %d\n",
|
"MAJOR problem we %p are still in pend pipe for %p done %d\n",
|
||||||
data, connptr, connptr->bits.done);
|
data, connptr, (int)connptr->bits.done);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3480,8 +3480,8 @@ int my_trace(CURL *handle, curl_infotype type,
|
|||||||
secs = tv.tv_sec;
|
secs = tv.tv_sec;
|
||||||
now = localtime(&secs); /* not multithread safe but we don't care */
|
now = localtime(&secs); /* not multithread safe but we don't care */
|
||||||
if(config->tracetime)
|
if(config->tracetime)
|
||||||
snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06d ",
|
snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld ",
|
||||||
now->tm_hour, now->tm_min, now->tm_sec, tv.tv_usec);
|
now->tm_hour, now->tm_min, now->tm_sec, (long)tv.tv_usec);
|
||||||
else
|
else
|
||||||
timebuf[0]=0;
|
timebuf[0]=0;
|
||||||
|
|
||||||
@ -4927,7 +4927,7 @@ show_error:
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if((res!=CURLE_OK) && config->showerror) {
|
if((res!=CURLE_OK) && config->showerror) {
|
||||||
fprintf(config->errors, "curl: (%d) %s\n", (int)res,
|
fprintf(config->errors, "curl: (%d) %s\n", res,
|
||||||
errorbuffer[0]? errorbuffer:
|
errorbuffer[0]? errorbuffer:
|
||||||
curl_easy_strerror((CURLcode)res));
|
curl_easy_strerror((CURLcode)res));
|
||||||
if(CURLE_SSL_CACERT == res) {
|
if(CURLE_SSL_CACERT == res) {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -79,13 +79,13 @@ static GlobCode glob_set(URLGlob *glob, char *pattern,
|
|||||||
switch (*pattern) {
|
switch (*pattern) {
|
||||||
case '\0': /* URL ended while set was still open */
|
case '\0': /* URL ended while set was still open */
|
||||||
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
||||||
"unmatched brace at pos %d\n", (int)pos);
|
"unmatched brace at pos %zu\n", pos);
|
||||||
return GLOB_ERROR;
|
return GLOB_ERROR;
|
||||||
|
|
||||||
case '{':
|
case '{':
|
||||||
case '[': /* no nested expressions at this time */
|
case '[': /* no nested expressions at this time */
|
||||||
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
||||||
"nested braces not supported at pos %d\n", (int)pos);
|
"nested braces not supported at pos %zu\n", pos);
|
||||||
return GLOB_ERROR;
|
return GLOB_ERROR;
|
||||||
|
|
||||||
case ',':
|
case ',':
|
||||||
@ -122,7 +122,7 @@ static GlobCode glob_set(URLGlob *glob, char *pattern,
|
|||||||
|
|
||||||
case ']': /* illegal closing bracket */
|
case ']': /* illegal closing bracket */
|
||||||
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
||||||
"illegal pattern at pos %d\n", (int)pos);
|
"illegal pattern at pos %zu\n", pos);
|
||||||
return GLOB_ERROR;
|
return GLOB_ERROR;
|
||||||
|
|
||||||
case '\\': /* escaped character, skip '\' */
|
case '\\': /* escaped character, skip '\' */
|
||||||
@ -141,7 +141,7 @@ static GlobCode glob_set(URLGlob *glob, char *pattern,
|
|||||||
if(skip) {
|
if(skip) {
|
||||||
if (*(buf+1) == '\0') { /* but no escaping of '\0'! */
|
if (*(buf+1) == '\0') { /* but no escaping of '\0'! */
|
||||||
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
||||||
"illegal pattern at pos %d\n", (int)pos);
|
"illegal pattern at pos %zu\n", pos);
|
||||||
return GLOB_ERROR;
|
return GLOB_ERROR;
|
||||||
}
|
}
|
||||||
++pattern;
|
++pattern;
|
||||||
@ -186,14 +186,14 @@ static GlobCode glob_range(URLGlob *glob, char *pattern,
|
|||||||
if ((rc < 3) || (min_c >= max_c) || ((max_c - min_c) > ('z' - 'a'))) {
|
if ((rc < 3) || (min_c >= max_c) || ((max_c - min_c) > ('z' - 'a'))) {
|
||||||
/* the pattern is not well-formed */
|
/* the pattern is not well-formed */
|
||||||
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
||||||
"error: bad range specification after pos %d\n", pos);
|
"error: bad range specification after pos %zu\n", pos);
|
||||||
return GLOB_ERROR;
|
return GLOB_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check the (first) separating character */
|
/* check the (first) separating character */
|
||||||
if((sep != ']') && (sep != ':')) {
|
if((sep != ']') && (sep != ':')) {
|
||||||
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
||||||
"error: unsupported character (%c) after range at pos %d\n",
|
"error: unsupported character (%c) after range at pos %zu\n",
|
||||||
sep, pos);
|
sep, pos);
|
||||||
return GLOB_ERROR;
|
return GLOB_ERROR;
|
||||||
}
|
}
|
||||||
@ -217,7 +217,7 @@ static GlobCode glob_range(URLGlob *glob, char *pattern,
|
|||||||
if ((rc < 2) || (min_n > max_n)) {
|
if ((rc < 2) || (min_n > max_n)) {
|
||||||
/* the pattern is not well-formed */
|
/* the pattern is not well-formed */
|
||||||
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
||||||
"error: bad range specification after pos %d\n", pos);
|
"error: bad range specification after pos %zu\n", pos);
|
||||||
return GLOB_ERROR;
|
return GLOB_ERROR;
|
||||||
}
|
}
|
||||||
pat->content.NumRange.ptr_n = pat->content.NumRange.min_n = min_n;
|
pat->content.NumRange.ptr_n = pat->content.NumRange.min_n = min_n;
|
||||||
@ -239,7 +239,7 @@ static GlobCode glob_range(URLGlob *glob, char *pattern,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
snprintf(glob->errormsg, sizeof(glob->errormsg),
|
||||||
"illegal character in range specification at pos %d\n", pos);
|
"illegal character in range specification at pos %zu\n", pos);
|
||||||
return GLOB_ERROR;
|
return GLOB_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user