mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-26 04:30:55 +00:00
Remove some dead code from DEH_LoadDehackedFile
Also fixes a buffer overflow, but said overflow generally got caught by the stack smashing protector. Still, it's better for SOC files not to be able to crash the game that easily.
This commit is contained in:
parent
f0f3b33d71
commit
6f0b4a4f6d
1 changed files with 0 additions and 15 deletions
|
@ -188,26 +188,11 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
|
|||
dbg_line = -1; // start at -1 so the first line is 0.
|
||||
while (!myfeof(f))
|
||||
{
|
||||
char origpos[128];
|
||||
INT32 size = 0;
|
||||
char *traverse;
|
||||
|
||||
myfgets(s, MAXLINELEN, f);
|
||||
memcpy(textline, s, MAXLINELEN);
|
||||
if (s[0] == '\n' || s[0] == '#')
|
||||
continue;
|
||||
|
||||
traverse = s;
|
||||
|
||||
while (traverse[0] != '\n')
|
||||
{
|
||||
traverse++;
|
||||
size++;
|
||||
}
|
||||
|
||||
strncpy(origpos, s, size);
|
||||
origpos[size] = '\0';
|
||||
|
||||
if (NULL != (word = strtok(s, " "))) {
|
||||
strupr(word);
|
||||
if (word[strlen(word)-1] == '\n')
|
||||
|
|
Loading…
Reference in a new issue