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
95f973fe98
commit
2e80cf9bba
@ -320,10 +320,13 @@ void __libnx_init_time(void)
|
||||
hour = tmp_offset % 24;
|
||||
|
||||
memset(envstr, 0, sizeof(envstr));
|
||||
|
||||
strptr = envstr;
|
||||
// Some tznames have numeric characters and '-'/'+', so quote tzname with <>.
|
||||
*strptr++ = '<';
|
||||
//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++ = '>';
|
||||
*strptr++ = is_west ? '+' : '-';
|
||||
|
||||
*strptr++ = '0' + (hour / 10);
|
||||
|
Loading…
Reference in New Issue
Block a user