fix minor valgrind read error
authorHong Shick Pak <hong@hspak.com>
Thu, 6 Nov 2014 05:33:20 +0000 (00:33 -0500)
committerHong Shick Pak <hong@hspak.com>
Thu, 6 Nov 2014 05:33:20 +0000 (00:33 -0500)
src/cstring.c

index d321260..558a786 100644 (file)
@@ -76,7 +76,7 @@ void cstring_strip(cstring_t *self, int pos, int len) {
         }
         return;
     }
-    memmove(&self->text[pos], &self->text[pos+len], self->size - pos);
+    memmove(&self->text[pos], &self->text[pos+len], self->size - pos - len+1);
     self->size -= len;
 }