output: fix timestamp localization on html page

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2017-01-12 22:40:33 +00:00
parent a905b50943
commit c4a654a149
No known key found for this signature in database
GPG key ID: A9553245FDE9B739

View file

@ -468,6 +468,8 @@ static void html_header(FILE *restrict f)
if (tmp == NULL) { if (tmp == NULL) {
error(EXIT_FAILURE, errno, "html_header: localtime"); error(EXIT_FAILURE, errno, "html_header: localtime");
} }
setlocale(LC_CTYPE, "");
setlocale(LC_NUMERIC, "");
if (strftime(outstr, sizeof(outstr), nl_langinfo(D_T_FMT), &result) == 0) { if (strftime(outstr, sizeof(outstr), nl_langinfo(D_T_FMT), &result) == 0) {
error(EXIT_FAILURE, 0, "html_header: strftime returned 0"); error(EXIT_FAILURE, 0, "html_header: strftime returned 0");
} }