core, pulse, modules: Fix undefined behavior with array subscript of invalid type

From the NetBSD manual:

     The first argument of these functions is of type int, but only a very
     restricted subset of values are actually valid.  The argument must either
     be the value of the macro EOF (which has a negative value), or must be a
     non-negative value within the range representable as unsigned char.
     Passing invalid values leads to undefined behavior.

     --  ctype(3)
This commit is contained in:
Kamil Rytarowski 2015-11-20 04:20:36 +01:00 committed by Arun Raghavan
parent 9dd77827ad
commit 93cccdee8d
5 changed files with 15 additions and 15 deletions

View file

@ -1442,7 +1442,7 @@ static bool contains_space(const char *string) {
pa_assert(string);
for (p = string; *p; ++p) {
if (isspace(*p))
if (isspace((unsigned char)*p))
return true;
}