Mercurial > hg > nnchat
changeset 32:67ec4073e38c
Check for NULL pointers (fixes "daemon" mode)
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 04 Aug 2008 06:44:11 +0300 |
parents | 9b429b283786 |
children | e49ea6febfeb |
files | nnchat.c |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/nnchat.c Sun Aug 03 12:02:03 2008 +0300 +++ b/nnchat.c Mon Aug 04 06:44:11 2008 +0300 @@ -249,6 +249,8 @@ time_t timeStamp; struct tm *tmpTime;; + if (statusWin == NULL) return; + timeStamp = time(NULL); if ((tmpTime = localtime(&timeStamp)) != NULL) { strftime(tmpStr, sizeof(tmpStr), "%H:%M:%S", tmpTime); @@ -286,6 +288,8 @@ void printEditBuf(char *str, editbuf_t *buf) { + if (statusWin == NULL || buf == NULL) return; + buf->data[buf->len] = 0; werase(editWin);