summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-05-18 08:36:43 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-05-19 14:32:43 +0200
commit162b871682946169871db3622e156ef641c44bf2 (patch)
tree0d66ae3c802ed8dff1fa366f6dbe42a8eff77264
parent9a85b790aab1611a7c9105d08fb6be1500ed82f7 (diff)
downloadcalcurse-162b871682946169871db3622e156ef641c44bf2.tar.gz
calcurse-162b871682946169871db3622e156ef641c44bf2.zip
src/notify.c: Fix printf() misuse
Make sure we actually copy the notification warning interval to the correct buffer instead of printing it to stdout (using an arbitrary format string). This makes sure the current warning interval is shown when editing the field and also eliminates a potential format string vulnerability. Spotted with "-Wformat-nonliteral". Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
-rw-r--r--src/notify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/notify.c b/src/notify.c
index 188d92c..3ed53bf 100644
--- a/src/notify.c
+++ b/src/notify.c
@@ -777,7 +777,7 @@ 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)