diff src/dmgrowbuf.c @ 1707:a0986cfd6f9d

More consistently use DMGrowBuf in the lib64gfx APIs, and implement "backwards" RLE decoding and encoding (optionally regards input/output). Not tested very much yet, there may be bugs.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 05 Jun 2018 21:58:10 +0300
parents 311b14855a1e
children e40227e994e2
line wrap: on
line diff
--- a/src/dmgrowbuf.c	Tue Jun 05 19:57:08 2018 +0300
+++ b/src/dmgrowbuf.c	Tue Jun 05 21:58:10 2018 +0300
@@ -218,7 +218,9 @@
             return FALSE;
     }
 
-    buf->len = nsize;
+    if (nsize > buf->len)
+        buf->len = nsize;
+
     return TRUE;
 }