Crash fix when starting up Doom Classic; sprnames list must be NULL-terminated #1

Merged
merged 1 commit into from Nov 27, 2012

Projects

None yet

3 participants

@JamesDunne
Contributor

Fixes a reproducible crash when built with VS2012 Premium in Debug and Retail builds.

@BrianHarris BrianHarris merged commit be311f4 into id-Software:master Nov 27, 2012
@revelator

Can change the (const char * const)NULL to '\0' works just as well and no need for a cast :)

Contributor

No I don't think it would, but stranger things have been known to happen. The code is searching for a NULL pointer value to terminate the list, not a pointer to a string containing a 0 character.

Im not sure why but it works fine though it may not be 100% correct.
Though a lot of compilers treat '\0' the same way as a const integral 0 atleast according to many discussions on the matter.

Compilers are indeed strange ;)

@JamesDunne
Contributor

Oh I see what you're saying, the '\0' character, not a "\0" string. Then yeah, that would work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment