diff src/dmpack.c @ 1103:fd1ccfc62ceb

Fix use of DM_FSEEK64().
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 03 Mar 2015 23:54:38 +0200
parents e06abfde6c39
children 5a8d29b88431
line wrap: on
line diff
--- a/src/dmpack.c	Tue Mar 03 23:22:36 2015 +0200
+++ b/src/dmpack.c	Tue Mar 03 23:54:38 2015 +0200
@@ -96,7 +96,14 @@
     pack->filename = dm_strdup(filename);
 
     // Read PACK header
-    DM_FSEEK64(pack->file, 0L, SEEK_SET);
+    if (DM_FSEEK64(pack->file, 0L, SEEK_SET) != 0)
+    {
+        ret = dmErrorDBG(dmGetErrno(),
+            "Failed to seek to file start '%s'.\n",
+            filename);
+        goto out;
+    }
+
     if (!dm_fread_str(pack->file, (Uint8 *) &hdr.ident, sizeof(hdr.ident)) ||
         !dm_fread_le16(pack->file, &hdr.version) ||
         !dm_fread_le32(pack->file, &hdr.dirEntries) ||