Resolve warnings about assignments within conditions.

- Working towards issue #11.
This commit is contained in:
Ari Koivula 2014-04-04 11:39:25 +03:00
parent d44d1837bb
commit 61ae195af7
2 changed files with 5 additions and 4 deletions

View file

@ -157,7 +157,6 @@ static int config_parse(config *cfg, const char *name, const char *value)
static const char * const colormatrix_names[] = { "GBR", "bt709", "undef", "", "fcc", "bt470bg", "smpte170m",
"smpte240m", "YCgCo", "bt2020nc", "bt2020c", NULL };
int i;
int error = 0;
if (!name)
@ -165,8 +164,9 @@ static int config_parse(config *cfg, const char *name, const char *value)
if (!value)
value = "true";
if ((!strncmp(name, "no-", 3) && (i = 3))) {
name += i;
// Treat "--no-param" as --param 0
if ((!strncmp(name, "no-", 3))) {
name += 3;
value = atobool(value) ? "false" : "true";
}

View file

@ -147,7 +147,8 @@ int main(int argc, char *argv[])
sprintf(dim_str, "_%dx%d.yuv", cfg->width, cfg->height);
left_len = strlen(cfg->debug);
right_len = strlen(dim_str);
if (!(cfg->debug = realloc(cfg->debug, left_len + right_len + 1))) {
cfg->debug = realloc(cfg->debug, left_len + right_len + 1);
if (!cfg->debug) {
fprintf(stderr, "realloc failed!\n");
return EXIT_FAILURE;
}