aboutsummaryrefslogtreecommitdiffstats
path: root/cookie.c
diff options
context:
space:
mode:
authorScarlett <scarlett@xavin.net>2015-01-15 09:54:54 +0000
committerTatsuya Kinoshita <tats@debian.org>2015-01-15 09:58:35 +0000
commitec8272d8fe937293212adb126ad1827a2640c36c (patch)
treea52452e8c39f7ef0e09054e8bd1bb606e9ddba07 /cookie.c
parentMerge branch 'bug/changelog' (diff)
downloadw3m-ec8272d8fe937293212adb126ad1827a2640c36c.tar.gz
w3m-ec8272d8fe937293212adb126ad1827a2640c36c.zip
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.
Diffstat (limited to 'cookie.c')
-rw-r--r--cookie.c6
1 files changed, 3 insertions, 3 deletions
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 : "",