summaryrefslogtreecommitdiff
path: root/xs_io.h
diff options
context:
space:
mode:
Diffstat (limited to 'xs_io.h')
-rw-r--r--xs_io.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/xs_io.h b/xs_io.h
index ca243ad..1379a34 100644
--- a/xs_io.h
+++ b/xs_io.h
@@ -84,6 +84,10 @@ d_char *xs_read(FILE *f, int *sz)
size -= r;
}
+ /* null terminate, just in case it's treated as a string */
+ s = xs_realloc(s, rdsz + 1);
+ s[rdsz] = '\0';
+
*sz = rdsz;
return s;