Mercurial > hg > nnchat
comparison nnchat.c @ 313:7c96f52e9a3b
memset() history buffer variable unconditionally to avoid derefencing uninitialized memory.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 11 Jun 2011 06:01:23 +0300 |
parents | cc9da9908731 |
children | 77f2093f9310 |
comparison
equal
deleted
inserted
replaced
312:a0c001672b44 | 313:7c96f52e9a3b |
---|---|
1247 int histPos = 0, histMax = 0; | 1247 int histPos = 0, histMax = 0; |
1248 | 1248 |
1249 cfgitem_t *tmpcfg; | 1249 cfgitem_t *tmpcfg; |
1250 char *homeDir = NULL; | 1250 char *homeDir = NULL; |
1251 | 1251 |
1252 memset(histBuf, 0, sizeof(histBuf)); | |
1252 | 1253 |
1253 /* Initialize */ | 1254 /* Initialize */ |
1254 th_init("NNChat", "Newbie Nudes chat client", NN_VERSION, | 1255 th_init("NNChat", "Newbie Nudes chat client", NN_VERSION, |
1255 "Written and designed by Anonymous Finnish Guy (C) 2008-2011", | 1256 "Written and designed by Anonymous Finnish Guy (C) 2008-2011", |
1256 "This software is freeware, use and distribute as you wish."); | 1257 "This software is freeware, use and distribute as you wish."); |
1456 prevTime = time(NULL); | 1457 prevTime = time(NULL); |
1457 srandom((int) prevTime); | 1458 srandom((int) prevTime); |
1458 | 1459 |
1459 if (cursesInit) { | 1460 if (cursesInit) { |
1460 /* Initialize rest of interactive UI code */ | 1461 /* Initialize rest of interactive UI code */ |
1461 memset(histBuf, 0, sizeof(histBuf)); | |
1462 nn_editbuf_clear(editBuf); | 1462 nn_editbuf_clear(editBuf); |
1463 | 1463 |
1464 /* First update of screen */ | 1464 /* First update of screen */ |
1465 printEditBuf(editBuf); | 1465 printEditBuf(editBuf); |
1466 updateStatus(); | 1466 updateStatus(); |