1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-12-07 01:56:35 +01:00

fix a few formatting bugs and simplify code a bit

This commit is contained in:
Jfreegman
2014-08-02 15:35:57 -04:00
parent fa023c6a99
commit 3cbe61e111
12 changed files with 48 additions and 83 deletions

View File

@@ -147,15 +147,10 @@ void line_info_add(ToxWindow *self, char *tmstmp, char *name1, char *name2, uint
char frmt_msg[MAX_STR_SIZE] = {0};
/* WARNING: SYS_MSG lines must not contain untrusted input */
if (type == SYS_MSG) {
va_list args;
va_start(args, msg);
vsnprintf(frmt_msg, sizeof(frmt_msg), msg, args);
va_end(args);
} else {
snprintf(frmt_msg, sizeof(frmt_msg), "%s", msg);
}
va_list args;
va_start(args, msg);
vsnprintf(frmt_msg, sizeof(frmt_msg), msg, args);
va_end(args);
int len = 1; /* there will always be a newline */