diff options
Diffstat (limited to 'make/config/joal-alc-impl-CustomCCode.c')
-rw-r--r-- | make/config/joal-alc-impl-CustomCCode.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/make/config/joal-alc-impl-CustomCCode.c b/make/config/joal-alc-impl-CustomCCode.c index 9207210..bd4a57a 100644 --- a/make/config/joal-alc-impl-CustomCCode.c +++ b/make/config/joal-alc-impl-CustomCCode.c @@ -1,6 +1,16 @@ +#include <stdbool.h> + +bool alc_is_double_null_terminated_string(ALCdevice *device, int param) { + return device == NULL && ( + param == ALC_DEVICE_SPECIFIER || + param == ALC_CAPTURE_DEVICE_SPECIFIER || + param == ALC_ALL_DEVICES_SPECIFIER + ); +} + int strlen_alc(ALCdevice *device, int param, const char* str) { int len = 0; - if ((device == NULL) && (param == ALC_DEVICE_SPECIFIER)) { + if (alc_is_double_null_terminated_string(device, param)) { while (*str != 0) { while (*str != 0) { ++str; |