Skip to content

Commit

Permalink
improve old comments, cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rfomin committed Jan 16, 2025
1 parent 3346410 commit 263498d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/d_deh.c
Original file line number Diff line number Diff line change
Expand Up @@ -2762,9 +2762,11 @@ static void deh_procCheat(DEHFILE *fpin, char *line) // done
if (!strcasecmp(key, cheat[ix].deh_cheat)) // found the cheat, ignored case
{
// replace it but don't overflow it. Use current length as
// limit. Ty 03/13/98 - add 0xff code Deal with the fact
// that the cheats in deh files are extended with character
// 0xFF to the original cheat length, which we don't do.
// limit.
// Ty 03/13/98 - add 0xff code
// Deal with the fact that the cheats in deh files are
// extended with character 0xFF to the original cheat
// length, which we don't do.
for (iy = 0; strval[iy]; iy++)
{
strval[iy] = (strval[iy] == (char)0xff) ? '\0' : strval[iy];
Expand All @@ -2779,10 +2781,10 @@ static void deh_procCheat(DEHFILE *fpin, char *line) // done
++p;
}
// Ty 03/16/98 - change to use a strdup and orphan the
// original Also has the advantage of allowing length
// changes.
// original.
// Also has the advantage of allowing length changes.
// strncpy(cheat[iy].cheat,p,strlen(cheat[iy].cheat));

//
// killough 9/12/98: disable cheats which are prefixes of
// this one
for (int i = 0; cheat[i].cheat; i++)
Expand Down Expand Up @@ -3464,7 +3466,7 @@ static void lfstrip(char *s) // strip the \r and/or \n off of a line
char *p = s + strlen(s);
while (p > s && (*--p == '\r' || *p == '\n'))
{
*p = 0;
*p = '\0';
}
}

Expand Down

0 comments on commit 263498d

Please sign in to comment.