aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-03-24 22:57:35 -0700
committerChris Robinson <[email protected]>2010-03-24 22:57:35 -0700
commitc8dd0246daae57ca09a7214348303b4bda1a60f6 (patch)
treeb8df24a8c349c124a87340254b336af6963c9fb6 /Alc/ALc.c
parentb3c389c0a0f8f9b414741151376c583a10462e8c (diff)
Fix alcGetEnumValue error handling
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index c5d9a00c..3ea5e38a 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -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;
}