mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
quote timezone to allow +/- & alphanumerics
This commit is contained in:
parent
6602c440b4
commit
e6b0955487
@ -320,10 +320,13 @@ void __libnx_init_time(void)
|
|||||||
hour = tmp_offset % 24;
|
hour = tmp_offset % 24;
|
||||||
|
|
||||||
memset(envstr, 0, sizeof(envstr));
|
memset(envstr, 0, sizeof(envstr));
|
||||||
|
strptr = envstr;
|
||||||
|
// Some tznames have numeric characters and '-'/'+', so quote tzname with <>.
|
||||||
|
*strptr++ = '<';
|
||||||
//Avoid using *printf.
|
//Avoid using *printf.
|
||||||
strncpy(envstr, /*info.timezoneName*/"NX", sizeof(envstr)-1); // Some tznames have numeric characters and '-'/'+', so the actual tzname can't be used.
|
strncpy(strptr, info.timezoneName, sizeof(envstr)-1);
|
||||||
strptr = &envstr[strlen(envstr)];
|
strptr = &envstr[strlen(envstr)];
|
||||||
|
*strptr++ = '>';
|
||||||
*strptr++ = is_west ? '+' : '-';
|
*strptr++ = is_west ? '+' : '-';
|
||||||
|
|
||||||
*strptr++ = '0' + (hour / 10);
|
*strptr++ = '0' + (hour / 10);
|
||||||
|
Loading…
Reference in New Issue
Block a user