changeset 2256:fe974f670d1d

Rename a variable.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 15 Jun 2019 22:53:25 +0300
parents 92385f9b7384
children c7495fcaffa9
files tools/gfxconv.c
diffstat 1 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/tools/gfxconv.c	Sat Jun 15 21:54:14 2019 +0300
+++ b/tools/gfxconv.c	Sat Jun 15 22:53:25 2019 +0300
@@ -1662,7 +1662,7 @@
     int ret = DMERR_OK;
     int outBlockW, outBlockH, bx, by;
     FILE *outFile = NULL;
-    Uint8 *buf = NULL;
+    Uint8 *tmpBuf = NULL;
     size_t outBufSize;
     char *outType;
 
@@ -1704,7 +1704,7 @@
         goto error;
     }
 
-    if ((buf = dmMalloc(outBufSize)) == NULL)
+    if ((tmpBuf = dmMalloc(outBufSize)) == NULL)
     {
         dmErrorMsg("Could not allocate %d bytes for conversion buffer.\n",
             outBufSize);
@@ -1720,7 +1720,7 @@
         switch (outFormat)
         {
             case FFMT_CHAR:
-                if (!dmConvertImage2Char(buf, image,
+                if (!dmConvertImage2Char(tmpBuf, image,
                     bx * D64_CHR_WIDTH_PX, by * D64_CHR_HEIGHT_PX,
                     multicolor))
                 {
@@ -1730,7 +1730,7 @@
                 break;
 
             case FFMT_SPRITE:
-                if (!dmConvertImage2Sprite(buf, image,
+                if (!dmConvertImage2Sprite(tmpBuf, image,
                     bx * D64_SPR_WIDTH_PX, by * D64_SPR_HEIGHT_PX,
                     multicolor))
                 {
@@ -1740,7 +1740,7 @@
                 break;
         }
 
-        if (!dm_fwrite_str(outFile, buf, outBufSize))
+        if (!dm_fwrite_str(outFile, tmpBuf, outBufSize))
         {
             ret = dmGetErrno();
             dmError(ret, "Error writing data block %d,%d to '%s', %d: %s\n",
@@ -1749,14 +1749,12 @@
         }
     }
 
-    fclose(outFile);
-    dmFree(buf);
-    return 0;
-
 error:
     if (outFile != NULL)
         fclose(outFile);
-    dmFree(buf);
+
+    dmFree(tmpBuf);
+
     return ret;
 }