mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:51:53 +03:00
curlx_now(), prevent zero timestamp
As code checks `curltime` values for zero and interprets this as not-initialized or "forever" in several places, make sure `curlx_now()` never returns a zero timestamp. Closes #21034
This commit is contained in:
parent
7e0a9b309c
commit
5649b21297
1 changed files with 2 additions and 0 deletions
|
|
@ -166,6 +166,8 @@ void curlx_pnow(struct curltime *pnow)
|
||||||
*/
|
*/
|
||||||
pnow->tv_sec = time(NULL);
|
pnow->tv_sec = time(NULL);
|
||||||
pnow->tv_usec = 0;
|
pnow->tv_usec = 0;
|
||||||
|
if(!pnow->tv_sec) /* avoid a `now` fully zero */
|
||||||
|
pnow->tv_usec = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue