diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-08-30 17:46:48 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-08-30 17:46:48 +0300 |
commit | 17d8406e6cae2a1be852acd5e6d40e6ce1f5073b (patch) | |
tree | 007ab38627b675f32daffce44cdeebca7ca77bdb | |
parent | 3e6783001198fe51f31a1acbc525f4af62f56540 (diff) | |
download | libmicrohttpd-17d8406e6cae2a1be852acd5e6d40e6ce1f5073b.tar.gz libmicrohttpd-17d8406e6cae2a1be852acd5e6d40e6ce1f5073b.zip |
get_date_str(): added error check
-rw-r--r-- | src/microhttpd/connection.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 51574113..bcb3f934 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -1322,7 +1322,8 @@ get_date_str (char *date) | |||
1322 | struct tm *pNow; | 1322 | struct tm *pNow; |
1323 | #endif | 1323 | #endif |
1324 | 1324 | ||
1325 | time (&t); | 1325 | if ((time_t) -1 == time (&t)) |
1326 | return false; | ||
1326 | #if defined(HAVE_C11_GMTIME_S) | 1327 | #if defined(HAVE_C11_GMTIME_S) |
1327 | if (NULL == gmtime_s (&t, | 1328 | if (NULL == gmtime_s (&t, |
1328 | &now)) | 1329 | &now)) |