about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-11-17 10:31:23 -0800
committerJames Booth <boothj5@gmail.com>2012-11-17 10:31:23 -0800
commit2fe5e7bd5914c3062e8f914492e4e745ab6b9a15 (patch)
tree2c61fb6c1b9169236586507c29eb3f4691e2fc88
parentb5d1a8edcba4b43ae6c88954299e9e70937e0fbb (diff)
parent52751d16aac48cc9264256d6bfb6253162cd80af (diff)
downloadprofani-tty-2fe5e7bd5914c3062e8f914492e4e745ab6b9a15.tar.gz
Merge pull request #84 from pasis/dev
_cmd_tiny: fix allocation for usage variable
-rw-r--r--src/command.c4
-rw-r--r--src/windows.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/command.c b/src/command.c
index 609b3817..a02c77e9 100644
--- a/src/command.c
+++ b/src/command.c
@@ -1301,7 +1301,7 @@ _cmd_tiny(const char * const inp, struct cmd_help_t help)
     if (args == NULL) {
         cons_show("Usage: %s", help.usage);
         if (win_in_chat()) {
-            char usage[strlen(help.usage + 8)];
+            char usage[strlen(help.usage) + 8];
             sprintf(usage, "Usage: %s", help.usage);
             win_show(usage);
         }
@@ -1660,7 +1660,7 @@ _cmd_set_boolean_preference(const char * const inp, struct cmd_help_t help,
         cons_show(disabled->str);
         set_func(FALSE);
     } else {
-        char usage[strlen(help.usage + 8)];
+        char usage[strlen(help.usage) + 8];
         sprintf(usage, "Usage: %s", help.usage);
         cons_show(usage);
     }
diff --git a/src/windows.c b/src/windows.c
index 5c86a90f..ebf57d6d 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -567,7 +567,7 @@ _win_notify_remind(gint unread)
     if (unread == 1) {
         sprintf(message, "1 unread message");
     } else {
-        sprintf(message, "%d unread messages", unread);
+        snprintf(message, sizeof(message), "%d unread messages", unread);
     }
 
     _win_notify(message, 5000, "Incoming message");