all repos — slstatus @ ec320f428a9b70d6b39228480df35a56ea992733

my build of slstatus (tools.suckless.org/slstatus/)

Merge pull request #8 from Vlaix/master

Fixed locale defaulting to English
Aaron Marcher info@nulltime.net
Thu, 10 Mar 2016 17:29:20 +0100
commit

ec320f428a9b70d6b39228480df35a56ea992733

parent

d4d2646f6387f0245ce1e285382f85b2cb6c0300

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M slstatus.cslstatus.c

@@ -3,6 +3,7 @@

/* global libraries */ #include <alsa/asoundlib.h> #include <fcntl.h> +#include <locale.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h>

@@ -191,11 +192,14 @@ char *buf = malloc(bufsize);

/* get time in format */ time(&tm); + setlocale(LC_TIME, ""); if(!strftime(buf, bufsize, timeformat, localtime(&tm))) { + setlocale(LC_TIME, "C"); fprintf(stderr, "Strftime failed.\n"); return smprintf("n/a"); } + setlocale(LC_TIME, "C"); /* return time */ return smprintf("%s", buf); }