From ec8272d8fe937293212adb126ad1827a2640c36c Mon Sep 17 00:00:00 2001 From: Scarlett Date: Thu, 15 Jan 2015 18:54:54 +0900 Subject: Correct printf arguments and use asprintf Origin: http://marc.info/?l=openbsd-ports&m=142090828929750&w=2 * Str.c: Use asprintf() instead of rolling our own printf string length detection. * cookie.c: Pass the char pointer in the string struct to printf %s instead of the string struct itself. Print time_t using %lld instead of %ld to allow for 64-bit time_t. * main.c: Print a long int using the correct format specifier. * map.c: Print size_t using the correct format specifier. --- cookie.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cookie.c') diff --git a/cookie.c b/cookie.c index 8020f6d..dbd698b 100644 --- a/cookie.c +++ b/cookie.c @@ -247,7 +247,7 @@ find_cookie(ParsedURL *pu) Strcat(tmp, Sprintf("; $Domain=\"%s\"", p1->domain->ptr)); if (p1->portl) Strcat(tmp, - Sprintf("; $Port=\"%s\"", portlist2str(p1->portl))); + Sprintf("; $Port=\"%s\"", portlist2str(p1->portl)->ptr)); } } return tmp; @@ -461,9 +461,9 @@ save_cookies(void) for (p = First_cookie; p; p = p->next) { if (!(p->flag & COO_USE) || p->flag & COO_DISCARD) continue; - fprintf(fp, "%s\t%s\t%s\t%ld\t%s\t%s\t%d\t%d\t%s\t%s\t%s\n", + fprintf(fp, "%s\t%s\t%s\t%lld\t%s\t%s\t%d\t%d\t%s\t%s\t%s\n", parsedURL2Str(&p->url)->ptr, - p->name->ptr, p->value->ptr, p->expires, + p->name->ptr, p->value->ptr, (long long) p->expires, p->domain->ptr, p->path->ptr, p->flag, p->version, str2charp(p->comment), (p->portl) ? portlist2str(p->portl)->ptr : "", -- cgit v1.2.3