changeset 1032:f8d75a51de2c

Implement raw uncompressed data copy.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 01 Mar 2015 16:27:05 +0200
parents f7863608d84c
children c353e6bcb733
files tools/packed.c
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tools/packed.c	Sun Mar 01 16:26:47 2015 +0200
+++ b/tools/packed.c	Sun Mar 01 16:27:05 2015 +0200
@@ -344,6 +344,22 @@
             }
         }
     }
+    else
+    {
+        while (!feof(inFile))
+        {
+            size_t read = fread(inBuffer, sizeof(Uint8), SET_TMPBUF_SIZE, inFile);
+            if (read > 0)
+            {
+                outSize += read;
+                if (fwrite(inBuffer, sizeof(Uint8), read, pack->file) != read)
+                {
+                    ret = DMERR_FWRITE;
+                    goto out;
+                }
+            }
+        }
+    }
 
     // Create directory entry
     strncpy(entry.filename, filename, sizeof(entry.filename));