aboutsummaryrefslogtreecommitdiffstats
path: root/field.c
diff options
context:
space:
mode:
Diffstat (limited to 'field.c')
-rw-r--r--field.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/field.c b/field.c
index 4819ea94..7b4f2190 100644
--- a/field.c
+++ b/field.c
@@ -277,6 +277,12 @@ set_record(const char *buf, int cnt)
/* copy the data */
memcpy(databuf, buf, cnt);
+ /*
+ * Add terminating '\0' so that C library routines
+ * will know when to stop.
+ */
+ databuf[cnt] = '\0';
+
/* manage field 0: */
unref(fields_arr[0]);
getnode(n);