diff options
author | Chris Robinson <[email protected]> | 2010-03-24 22:57:35 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-03-24 22:57:35 -0700 |
commit | c8dd0246daae57ca09a7214348303b4bda1a60f6 (patch) | |
tree | b8df24a8c349c124a87340254b336af6963c9fb6 /Alc/ALc.c | |
parent | b3c389c0a0f8f9b414741151376c583a10462e8c (diff) |
Fix alcGetEnumValue error handling
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1181,16 +1181,16 @@ ALC_API ALCvoid* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumName) { ALsizei i = 0; - ALCenum val; - while(enumeration[i].enumName && strcmp(enumeration[i].enumName,enumName) == 0) - i++; - val = enumeration[i].value; - - if(!enumeration[i].enumName) + if(!enumName) + { alcSetError(device, ALC_INVALID_VALUE); + return (ALCenum)0; + } - return val; + while(enumeration[i].enumName && strcmp(enumeration[i].enumName,enumName) == 0) + i++; + return enumeration[i].value; } |