Fix inability to open CoreAudio device if it contains non-ASCII characters

This commit is contained in:
Cameron Gutman 2018-10-12 23:50:45 -07:00 committed by Andrew Kelley
parent 2bb21ad417
commit e0f0f6a7a2

View file

@ -179,7 +179,7 @@ static int from_cf_string(CFStringRef string_ref, char **out_str, int *out_str_l
assert(string_ref);
CFIndex length = CFStringGetLength(string_ref);
CFIndex max_size = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
CFIndex max_size = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8) + 1;
char *buf = ALLOCATE_NONZERO(char, max_size);
if (!buf)
return SoundIoErrorNoMem;