changeset 385:bbd5edbf1143

Cosmetics.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 29 Dec 2011 00:34:46 +0200
parents 40b95d677f68
children 4523fc0941e8
files nnchat.c
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/nnchat.c	Thu Oct 13 18:07:33 2011 +0300
+++ b/nnchat.c	Thu Dec 29 00:34:46 2011 +0200
@@ -536,9 +536,7 @@
 
 void errorMsgV(const char *fmt, va_list ap)
 {
-    char *tmp;
-
-    tmp = th_strdup_vprintf(fmt, ap);
+    char *tmp = th_strdup_vprintf(fmt, ap);
 
     printMsg(NULL, "%s", tmp);
     
@@ -1547,10 +1545,13 @@
                 size_t bufLen = strlen(ptr) + 1;
                 int result = handleProtocol(conn, ptr, bufLen);
 
-                if (result > 0) {
+                if (result > 0)
+                {
                     /* Couldn't handle the message for some reason */
                     printMsg(currWin, "Could not handle: %s\n", ptr);
-                } else if (result < 0) {
+                }
+                else if (result < 0)
+                {
                     /* Fatal error, quit */
                     errorMsg("Fatal error with message: %s\n", ptr);
                     isError = TRUE;
@@ -1649,7 +1650,8 @@
                 erase();
                 timeout(SET_DELAY);
 
-                if (!initializeWindows()) {
+                if (!initializeWindows())
+                {
                     errorMsg("Error resizing curses chatWindows\n");
                     isError = TRUE;
                 }
@@ -1679,7 +1681,8 @@
                     
                     nn_editbuf_clear(editBuf);
                     
-                    if (result < 0) {
+                    if (result < 0)
+                    {
                         errorMsg("Fatal error handling user input: %s\n", editBuf->data);
                         isError = TRUE;
                     } else {
@@ -1779,7 +1782,7 @@
             
             case 0x03: /* ^C = quit */
             case KEY_F(9): /* F9 = Quit */
-                printMsg(currWin, "Quitting per user request.\n");
+                printMsg(currWin, "Quitting per user request (%d/0x%x).\n", c, c);
                 exitProg = TRUE;
                 break;