changeset 112:c4865ac2386c

Fix right-side trimming of command line.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 24 Oct 2010 21:38:17 +0300
parents 9db08807018f
children 2a53156e7e12
files nnchat.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/nnchat.c	Sun Oct 24 18:44:59 2010 +0300
+++ b/nnchat.c	Sun Oct 24 21:38:17 2010 +0300
@@ -559,7 +559,8 @@
     BOOL result;
     
     /* Trim right */
-    buf[--bufLen] = 0;
+    bufLen--;
+    buf[bufLen--] = 0;
     while (bufLen > 0 && (buf[bufLen] == '\n' || buf[bufLen] == '\r' || th_isspace(buf[bufLen])))
         buf[bufLen--] = 0;
     
@@ -585,7 +586,7 @@
         snprintf(tmpBuf, sizeof(tmpBuf), "firefox -remote \"openurl(http://www.newbienudes.com/profile/%s/,new-tab)\"", tmpStr);
         th_free(tmpStr);
 
-        printMsg("Opening profile for: %s\n", name);
+        printMsg("Opening profile for: '%s'\n", name);
         printMsg("%s\n", tmpBuf);
         system(tmpBuf);
         return 0;