diff options
author | Chris Robinson <[email protected]> | 2009-11-19 18:49:24 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-11-19 18:49:24 -0800 |
commit | 1483af1baab70db6e6998e99c5bc9a73a1f77d8f (patch) | |
tree | 64921f32a59e6024179b6a06ab28c33e7b2e3f22 | |
parent | 13979793f6c923b1b91dde2c4f95cd6f351f14d5 (diff) |
Watch for NULL and empty device lists
-rw-r--r-- | examples/openal-info.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/openal-info.c b/examples/openal-info.c index 9b49f7e2..df0bd88a 100644 --- a/examples/openal-info.c +++ b/examples/openal-info.c @@ -132,12 +132,13 @@ static void printDevices(ALCenum which, const char *kind) checkForErrors(); printf("Available %sdevices:\n", kind); - while(*s != '\0') - { + if(s == NULL || *s == '\0') + printf(" (none!)\n"); + else do { printf(" %s\n", s); while(*s++ != '\0') ; - } + } while(*s != '\0'); } static void printALCInfo (void) |