[mode] Fix a sizeof error

I'm surprised that got past gcc, but it's nice clang caught it.
This commit is contained in:
Bill Currie 2022-03-31 00:30:00 +09:00
parent 0bb562f93f
commit 78089a0e99

View file

@ -178,7 +178,7 @@ Mod_RealLoadModel (model_t *mod, qboolean crash, cache_allocator_t allocator)
} }
char *name = QFS_FileBase (mod->path); char *name = QFS_FileBase (mod->path);
strncpy (mod->name, name, sizeof (mod->name - 1)); strncpy (mod->name, name, sizeof (mod->name) - 1);
mod->name[sizeof (mod->name) - 1] = 0; mod->name[sizeof (mod->name) - 1] = 0;
free (name); free (name);