1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:24:57 +00:00

LibC: Ensure tzname and related fields are intialized

If a program never invokes tzset, the tzname variable should have system
dependent default values.
This commit is contained in:
Timothy Flynn 2022-01-24 19:44:44 -05:00 committed by Linus Groh
parent cd0e5ccd3f
commit 024f869f09

View file

@ -354,15 +354,15 @@ size_t strftime(char* destination, size_t max_size, const char* format, const st
return fits ? str.length() : 0;
}
long timezone;
long altzone;
char* tzname[2];
int daylight;
static char __tzname_standard[TZNAME_MAX];
static char __tzname_daylight[TZNAME_MAX];
constexpr const char* __utc = "UTC";
long timezone = 0;
long altzone = 0;
char* tzname[2] = { const_cast<char*>(__utc), const_cast<char*>(__utc) };
int daylight = 0;
void tzset()
{
// FIXME: Actually parse the TZ environment variable, described here: