]> git.ipfire.org Git - thirdparty/git.git/commit
banned.h: mark non-reentrant gmtime, etc as banned
authorJeff King <peff@peff.net>
Tue, 1 Dec 2020 21:11:37 +0000 (13:11 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 1 Dec 2020 22:37:27 +0000 (14:37 -0800)
commit1fbfdf556f2abc708183caca53ae4e2881b46ae2
tree722feecb837c8e7d03a7299ad75c6b6e6e1146d9
parent72ffeb997eaf999f6938b2a7e0d9a75dcceaa311
banned.h: mark non-reentrant gmtime, etc as banned

The traditional gmtime(), localtime(), ctime(), and asctime() functions
return pointers to shared storage. This means they're not thread-safe,
and they also run the risk of somebody holding onto the result across
multiple calls (where each call invalidates the previous result).

All callers should be using their reentrant counterparts.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
banned.h