ao_coreaudio: fix inverted condition

And also use the correct type for the printf call below.
This commit is contained in:
wm4 2015-04-10 13:51:13 +02:00
parent 46eb04f3c2
commit 77869e5914
1 changed files with 4 additions and 3 deletions

View File

@ -141,16 +141,17 @@ char *fourcc_repr(void *talloc_ctx, uint32_t code)
};
bool valid_fourcc = true;
for (int i = 0; i < 4; i++)
if (fcc[i] >= 32 && fcc[i] < 128)
for (int i = 0; i < 4; i++) {
if (fcc[i] < 32 || fcc[i] >= 128)
valid_fourcc = false;
}
char *repr;
if (valid_fourcc)
repr = talloc_asprintf(talloc_ctx, "'%c%c%c%c'",
fcc[0], fcc[1], fcc[2], fcc[3]);
else
repr = talloc_asprintf(NULL, "%d", code);
repr = talloc_asprintf(NULL, "%u", (unsigned int)code);
return repr;
}