Преглед изворни кода

* Fixed another valgrind error

svn: 515
Bryan Drewery пре 22 година
родитељ
комит
f06f87bf25
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/net.c

+ 1 - 1
src/net.c

@@ -1464,7 +1464,7 @@ int sockgets(char *s, int *len)
     strcpy(s, xx);
 //    strcpy(xx, p + 1);
     sprintf(xx, "%s", p + 1);
-    if (s[strlen(s) - 1] == '\r')
+    if (s[0] && strlen(s) && (s[strlen(s) - 1] == '\r'))
       s[strlen(s) - 1] = 0;
     data = 1;			/* DCC_CHAT may now need to process a blank line */
 /* NO! */