1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-02-02 15:08:15 -05:00

Merge pull request #84 from pasis/dev

_cmd_tiny: fix allocation for usage variable
This commit is contained in:
James Booth 2012-11-17 10:31:23 -08:00
commit 2fe5e7bd59
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}

View File

@ -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");