Fix classic off-by-one error - the answer is strlen() + 1, not just strlen()
[p5sagit/Devel-Size.git] / Size.xs
diff --git a/Size.xs b/Size.xs
index 1c8a0f3..654ff39 100644 (file)
--- a/Size.xs
+++ b/Size.xs
@@ -333,7 +333,7 @@ magic_size(const SV * const thing, struct state *st) {
 static void
 check_new_and_strlen(struct state *st, const char *const p) {
     if(check_new(st, p))
-       st->total_size += strlen(p);
+       st->total_size += 1 + strlen(p);
 }
 
 static void