summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjohannes <johannes.herman@gmail.com>2024-02-07 14:53:55 +0100
committerjohannes <johannes.herman@gmail.com>2024-02-07 14:53:55 +0100
commitd67c36c7b8457a78f2a0080fd79b062f6c9142c7 (patch)
treefcda8a7647c5068774bd76492305fc6e041e2437 /src
parentaa6b62c010240c2dca5d37c6b5fc6ff4c2b80d99 (diff)
fixed bug in writedemomap, did not write mapmagic
Diffstat (limited to 'src')
-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;
}