summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2022-03-20 20:53:10 +0100
committerTim Rühsen <tim.ruehsen@gmx.de>2022-03-20 20:53:10 +0100
commit1cda2bb5d591f564db2f5bbfcb60ba31b6351ca0 (patch)
treeb6e4e1976820ffe26ef5fd72c5e495c469fcf5e7
parent565f566fab57a84a21671da8f67119873e6d2ce1 (diff)
downloadwget-1cda2bb5d591f564db2f5bbfcb60ba31b6351ca0.tar.gz
src/http.c (time_to_rfc1123): Fix -Wformat-nonliteral
-rw-r--r--src/http.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/http.c b/src/http.c
index f61c99a7..2ecc11c9 100644
--- a/src/http.c
+++ b/src/http.c
@@ -1826,8 +1826,6 @@ time_to_rfc1123 (time_t time, char *buf, size_t bufsize)
static const char *month[] = { "Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec" };
- /* rfc1123 example: Thu, 01 Jan 1998 22:12:57 GMT */
- static const char *time_format = "%s, %02d %s %04d %02d:%02d:%02d GMT";
struct tm *gtm = gmtime (&time);
if (!gtm)
@@ -1837,7 +1835,9 @@ time_to_rfc1123 (time_t time, char *buf, size_t bufsize)
return TIMECONV_ERR;
}
- snprintf (buf, bufsize, time_format, wkday[gtm->tm_wday],
+ /* rfc1123 example: Thu, 01 Jan 1998 22:12:57 GMT */
+ snprintf (buf, bufsize, "%s, %02d %s %04d %02d:%02d:%02d GMT",
+ wkday[gtm->tm_wday],
gtm->tm_mday, month[gtm->tm_mon],
gtm->tm_year + 1900, gtm->tm_hour,
gtm->tm_min, gtm->tm_sec);