fix state corruption
authornotaz <notasas@gmail.com>
Sat, 29 Sep 2012 19:10:28 +0000 (22:10 +0300)
committernotaz <notasas@gmail.com>
Sat, 29 Sep 2012 19:10:28 +0000 (22:10 +0300)
state.c

diff --git a/state.c b/state.c
index deacbbf..ab2f0c9 100644 (file)
--- a/state.c
+++ b/state.c
@@ -289,9 +289,9 @@ void SaveState(void)
 
         if(st!=NULL)
         {
 
         if(st!=NULL)
         {
-         static uint32 totalsize;
-         static uint8 header[16]="FCS";
-         memset(header+4,0,13);
+         uint32 totalsize;
+         uint8 header[16]="FCS";
+         memset(header+4,0,sizeof(header)-4);
          header[3]=VERSION_NUMERIC;
          fwrite(header,1,16,st);
 
          header[3]=VERSION_NUMERIC;
          fwrite(header,1,16,st);