mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-31 23:36:22 +00:00
Merge pull request #84 from pasis/dev
_cmd_tiny: fix allocation for usage variable
This commit is contained in:
@@ -1301,7 +1301,7 @@ _cmd_tiny(const char * const inp, struct cmd_help_t help)
|
|||||||
if (args == NULL) {
|
if (args == NULL) {
|
||||||
cons_show("Usage: %s", help.usage);
|
cons_show("Usage: %s", help.usage);
|
||||||
if (win_in_chat()) {
|
if (win_in_chat()) {
|
||||||
char usage[strlen(help.usage + 8)];
|
char usage[strlen(help.usage) + 8];
|
||||||
sprintf(usage, "Usage: %s", help.usage);
|
sprintf(usage, "Usage: %s", help.usage);
|
||||||
win_show(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);
|
cons_show(disabled->str);
|
||||||
set_func(FALSE);
|
set_func(FALSE);
|
||||||
} else {
|
} else {
|
||||||
char usage[strlen(help.usage + 8)];
|
char usage[strlen(help.usage) + 8];
|
||||||
sprintf(usage, "Usage: %s", help.usage);
|
sprintf(usage, "Usage: %s", help.usage);
|
||||||
cons_show(usage);
|
cons_show(usage);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -567,7 +567,7 @@ _win_notify_remind(gint unread)
|
|||||||
if (unread == 1) {
|
if (unread == 1) {
|
||||||
sprintf(message, "1 unread message");
|
sprintf(message, "1 unread message");
|
||||||
} else {
|
} else {
|
||||||
sprintf(message, "%d unread messages", unread);
|
snprintf(message, sizeof(message), "%d unread messages", unread);
|
||||||
}
|
}
|
||||||
|
|
||||||
_win_notify(message, 5000, "Incoming message");
|
_win_notify(message, 5000, "Incoming message");
|
||||||
|
|||||||
Reference in New Issue
Block a user