changeset 1539:2acf4578d2e6

Cleanup.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 12 May 2018 04:55:05 +0300
parents af729e29a6f6
children 237be4e03585
files tools/lib64fmts.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64fmts.c	Sat May 12 04:54:36 2018 +0300
+++ b/tools/lib64fmts.c	Sat May 12 04:55:05 2018 +0300
@@ -181,9 +181,8 @@
     if ((res = dmGrowBufAlloc(&tmp, len + 4, 4)) != DMERR_OK)
         return res;
 
-    tmp.len = len;
-    memcpy(tmp.data, buf, len);
-    tmp.data[tmp.len++] = 0;
+    memcpy(tmp.data, buf, len + 1);
+    tmp.len = len + 1;
 
     // Now do an RLE decode on the enlarged buffer
     cfg.type = DM_COMP_RLE_MARKER;