diff options
-rw-r--r-- | fmd.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -84,7 +84,7 @@ void fmd_load(struct fmd *fmd, FILE *f) ret = fread(*m, len, 1, f); assert(ret == 1); - *m[len] = '\0'; + (*m)[len] = '\0'; } fmd->nmeshes = betoul(f); @@ -94,7 +94,9 @@ void fmd_load(struct fmd *fmd, FILE *f) fmd->meshes = NULL; for (int i = 0; i < fmd->nmeshes; i++) { struct fmd_mesh *m = &fmd->meshes[i]; - m->midx = betoul(f); + unsigned long midx; + midx = betoul(f); + m->midx = midx == 0xffffffff ? -1 : (int)midx; m->tidx = betoul(f); m->tcnt = betoul(f); } |