# HG changeset patch # User Matti Hamalainen # Date 1337824947 -10800 # Node ID 3f20ac9a9e1d40cd1b502aab9ae28e4d39b4be3d # Parent ec974049ccbac6d47ff9b5c43cb1890b7d6819ab Using th_isspace() should be enough to detect \r and \n. diff -r ec974049ccba -r 3f20ac9a9e1d nnchat.c --- a/nnchat.c Thu May 24 05:01:46 2012 +0300 +++ b/nnchat.c Thu May 24 05:02:27 2012 +0300 @@ -911,7 +911,7 @@ /* Trim right */ bufLen--; buf[bufLen--] = 0; - while (bufLen > 0 && (buf[bufLen] == '\n' || buf[bufLen] == '\r' || th_isspace(buf[bufLen]))) + while (bufLen > 0 && th_isspace(buf[bufLen])) buf[bufLen--] = 0; /* Decode completed usernames */ @@ -1391,7 +1391,7 @@ if (curVis != ERR) curs_set(curVis); - for (pos = strlen(tmpBuf) - 1; pos > 0 && (tmpBuf[pos] == '\n' || tmpBuf[pos] == '\r' || th_isspace(tmpBuf[pos])); pos--) + for (pos = strlen(tmpBuf) - 1; pos > 0 && th_isspace(tmpBuf[pos]); pos--) tmpBuf[pos] = 0; ptr = str_trim_left(tmpBuf);