[gimp] Issue #5415: compensate for null byte



commit 4d528f297fc7395cde49ec642018736be8b0b4c6
Author: Michael Bazzinotti <mbazzinotti gmail com>
Date:   Thu Jul 16 08:45:20 2020 -0400

    Issue #5415: compensate for null byte
    
    When exporting a C source file with runtime length encoding, the
    C-string's array size does not accomodate for the null byte. However,
    GIMP accomodates for the NULL byte in it's NON-RLE export, suggesting
    that this has been a mere oversight for RLE.
    
    This can cause at the worst a compile-time error and at least a warning
    from the compiler.

 plug-ins/common/file-csource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/plug-ins/common/file-csource.c b/plug-ins/common/file-csource.c
index 43c0e07233..078f92219d 100644
--- a/plug-ins/common/file-csource.c
+++ b/plug-ins/common/file-csource.c
@@ -873,7 +873,7 @@ save_image (GFile         *file,
       if (config_use_rle)
         {
           if (! print (output, error,
-                       "%u] =\n",
+                       "%u + 1] =\n",
                        (guint) (img_buffer_end - img_buffer)))
             goto fail;
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]