[util] Fix a string handling bug

Good grief, they still exist :(
This commit is contained in:
Bill Currie 2021-03-27 20:06:40 +09:00
parent 8309e1852a
commit c4a0f3cc73

View file

@ -1055,11 +1055,10 @@ _QFS_VOpenFile (const char *filename, int zip,
ind = 0;
#ifdef HAVE_VORBIS
if (strequal (".wav", QFS_FileExtension (path))) {
char *oggfilename;
oggfilename = alloca (strlen (path) + 1);
size_t len = strlen (path);
char *oggfilename = alloca (len + 1);
QFS_StripExtension (path, oggfilename);
strncat (oggfilename, ".ogg",
sizeof (oggfilename) - strlen (oggfilename) - 1);
strcat (oggfilename, ".ogg");
fnames[ind] = oggfilename;
zip_flags[ind] = 0;
ind++;