aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-11-19 18:49:24 -0800
committerChris Robinson <[email protected]>2009-11-19 18:49:24 -0800
commit1483af1baab70db6e6998e99c5bc9a73a1f77d8f (patch)
tree64921f32a59e6024179b6a06ab28c33e7b2e3f22 /examples
parent13979793f6c923b1b91dde2c4f95cd6f351f14d5 (diff)
Watch for NULL and empty device lists
Diffstat (limited to 'examples')
-rw-r--r--examples/openal-info.c7
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)