summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/demo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/demo.c b/src/demo.c
index 1cf6c63..7ecf72e 100644
--- a/src/demo.c
+++ b/src/demo.c
@@ -355,13 +355,17 @@ int writedemotimeline(FILE *fp, demotimeline *dt)
int writedemomap(FILE *fp, demomap *dm, int mapsize, unsigned char ver)
{
if (ver >= 6)
+ {
+ // TODO is this magic for v6+ only?
+ if (fwrite(mapmagic, 1, sizeof(mapmagic), fp) != sizeof(mapmagic))
+ return -1;
if (fwrite(dm->sha256, 1, 32, fp) != 32)
return -1;
+ }
if (fwrite(dm->data, 1, mapsize, fp) != mapsize)
return -2;
-
return 1;
}