summaryrefslogtreecommitdiff
path: root/vchat-ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'vchat-ui.c')
-rw-r--r--vchat-ui.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/vchat-ui.c b/vchat-ui.c
index 81db925..90c7e9a 100644
--- a/vchat-ui.c
+++ b/vchat-ui.c
@@ -398,7 +398,8 @@ int writecf(formtstr id, char *str) {
398 struct sb_entry *tmp; 398 struct sb_entry *tmp;
399 int i = 0; 399 int i = 0;
400 time_t now = time(NULL); 400 time_t now = time(NULL);
401 snprintf(tmpstr, TMPSTRSIZE, getformatstr(id), str); 401 if (snprintf(tmpstr, TMPSTRSIZE, getformatstr(id), str) < 0)
402 return 0;
402 tmp = sb_add(sb_pub, tmpstr, now); 403 tmp = sb_add(sb_pub, tmpstr, now);
403 404
404 if ((sb_pub->scroll == sb_pub->count) && 405 if ((sb_pub->scroll == sb_pub->count) &&
@@ -1369,15 +1370,17 @@ void consoleline(char *message) {
1369 char date[10]; 1370 char date[10];
1370 time_t now = time(NULL); 1371 time_t now = time(NULL);
1371 strftime(date, sizeof(date), getformatstr(FS_CONSOLETIME), localtime(&now)); 1372 strftime(date, sizeof(date), getformatstr(FS_CONSOLETIME), localtime(&now));
1372 snprintf(tmpstr, TMPSTRSIZE, "%s%s", date, consolestr); 1373 if (snprintf(tmpstr, TMPSTRSIZE, "%s%s", date, consolestr) < 0)
1374 return;
1373 mvwaddnstr(console, 0, 0, tmpstr, getmaxx(console) - 1); 1375 mvwaddnstr(console, 0, 0, tmpstr, getmaxx(console) - 1);
1374 } else { 1376 } else {
1375 mvwaddnstr(console, 0, 0, message ? message : consolestr, 1377 mvwaddnstr(console, 0, 0, message ? message : consolestr,
1376 getmaxx(console) - 1); 1378 getmaxx(console) - 1);
1377 } 1379 }
1378 1380
1379 snprintf(tmpstr, TMPSTRSIZE, getformatstr(FS_SBINF), sb_pub->scroll, 1381 if (snprintf(tmpstr, TMPSTRSIZE, getformatstr(FS_SBINF), sb_pub->scroll,
1380 sb_pub->count); 1382 sb_pub->count) < 0)
1383 return;
1381 mvwaddstr(console, 0, getmaxx(console) - 1 - (strlen(tmpstr) - 1), tmpstr); 1384 mvwaddstr(console, 0, getmaxx(console) - 1 - (strlen(tmpstr) - 1), tmpstr);
1382 if (sb_win == 0) 1385 if (sb_win == 0)
1383 mvwaddch(console, 0, getmaxx(console) - 1, '*'); 1386 mvwaddch(console, 0, getmaxx(console) - 1, '*');