소스 검색

* Fixed an rmspace() segfault bug

svn: 424
Bryan Drewery 22 년 전
부모
커밋
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);