From b4cf3cc470eb1200ec90fcc7ad5b2d069059cf7e Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 11 Nov 2014 23:12:01 +0200 Subject: Fix memory growth problem. --- field.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'field.c') 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); -- cgit v1.2.3