1
0
Эх сурвалжийг харах

* Fixed an rmspace() segfault bug

svn: 424
Bryan Drewery 22 жил өмнө
parent
commit
35a87efb0b
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      src/chanprog.c

+ 2 - 1
src/chanprog.c

@@ -61,7 +61,8 @@ void rmspace(char *s)
 
   /* Wipe end of string */
   for (p = s + strlen(s) - 1; ((whitespace(*p)) && (p >= s)); p--);
-  *(p + 1) = 0;
+  if (p != s + strlen(s) - 1)
+    *(p + 1) = 0;
   len = p+1 - s;
   for (p = s; ((whitespace(*p)) && (*p)); p++);
   len -= (p - s);