aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/notify.c2
-rw-r--r--src/pcal.c2
-rw-r--r--src/utils.c9
3 files changed, 10 insertions, 3 deletions
diff --git a/src/notify.c b/src/notify.c
index 2be4571..c746f49 100644
--- a/src/notify.c
+++ b/src/notify.c
@@ -716,7 +716,7 @@ void notify_config_bar(void)
case '4':
status_mesg(count_str, "");
pthread_mutex_lock(&nbar.mutex);
- printf(buf, "%d", nbar.cntdwn);
+ snprintf(buf, BUFSIZ, "%d", nbar.cntdwn);
pthread_mutex_unlock(&nbar.mutex);
if (updatestring(win[STA].p, &buf, 0, 1) == 0 &&
is_all_digit(buf) && atoi(buf) >= 0 && atoi(buf) <= DAYINSEC) {
diff --git a/src/pcal.c b/src/pcal.c
index 244a20a..c4f731d 100644
--- a/src/pcal.c
+++ b/src/pcal.c
@@ -103,7 +103,7 @@ static void pcal_export_header(FILE * stream)
fprintf(stream, "opt -A -K -l -m -F %s\n",
calendar_week_begins_on_monday()? "Monday" : "Sunday");
fputs("# Display week number (i.e. 1-52) on every Monday\n", stream);
- fprintf(stream, "all monday in all %s %%w\n", _("Week"));
+ fprintf(stream, "all monday in all week %%w\n");
fputc('\n', stream);
}
diff --git a/src/utils.c b/src/utils.c
index ad88117..b3d9c71 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -386,8 +386,15 @@ char *date_sec2date_str(long sec, const char *datefmt)
/* Generic function to format date. */
void date_sec2date_fmt(long sec, const char *fmt, char *datef)
{
- struct tm *lt = localtime((time_t *) & sec);
+ /* TODO: Find a better way to deal with localization and strftime(). */
+ char *locale_old = mem_strdup (setlocale (LC_ALL, NULL));
+ setlocale (LC_ALL, "C");
+
+ struct tm *lt = localtime((time_t *)&sec);
strftime(datef, BUFSIZ, fmt, lt);
+
+ setlocale (LC_ALL, locale_old);
+ mem_free (locale_old);
}
/*