X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=cmdutils.c;h=a71c7db8cf8b5fee1ef66ffd4cef21835ec3eddd;hb=0744daa887cab007404388da9cba34149781c605;hp=67bb66e9b59e212334de84eb705ac09faa19d876;hpb=2fd87a3d7895ce36e558a306d03e33697d456086;p=ffmpeg diff --git a/cmdutils.c b/cmdutils.c index 67bb66e9b59..a71c7db8cf8 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -166,7 +166,7 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags, int first; first = 1; - for (po = options; po->name != NULL; po++) { + for (po = options; po->name; po++) { char buf[64]; if (((po->flags & req_flags) != req_flags) || @@ -205,7 +205,7 @@ static const OptionDef *find_option(const OptionDef *po, const char *name) const char *p = strchr(name, ':'); int len = p ? p - name : strlen(name); - while (po->name != NULL) { + while (po->name) { if (!strncmp(name, po->name, len) && strlen(po->name) == len) break; po++; @@ -254,7 +254,7 @@ static void prepare_app_arguments(int *argc_ptr, char ***argv_ptr) win32_argv_utf8 = av_mallocz(sizeof(char *) * (win32_argc + 1) + buffsize); argstr_flat = (char *)win32_argv_utf8 + sizeof(char *) * (win32_argc + 1); - if (win32_argv_utf8 == NULL) { + if (!win32_argv_utf8) { LocalFree(argv_w); return; } @@ -1242,7 +1242,7 @@ static int show_formats_devices(void *optctx, const char *opt, const char *arg, is_dev = is_device(ofmt->priv_class); if (!is_dev && device_only) continue; - if ((name == NULL || strcmp(ofmt->name, name) < 0) && + if ((!name || strcmp(ofmt->name, name) < 0) && strcmp(ofmt->name, last_name) > 0) { name = ofmt->name; long_name = ofmt->long_name; @@ -1253,7 +1253,7 @@ static int show_formats_devices(void *optctx, const char *opt, const char *arg, is_dev = is_device(ifmt->priv_class); if (!is_dev && device_only) continue; - if ((name == NULL || strcmp(ifmt->name, name) < 0) && + if ((!name || strcmp(ifmt->name, name) < 0) && strcmp(ifmt->name, last_name) > 0) { name = ifmt->name; long_name = ifmt->long_name; @@ -1262,7 +1262,7 @@ static int show_formats_devices(void *optctx, const char *opt, const char *arg, if (name && strcmp(ifmt->name, name) == 0) decode = 1; } - if (name == NULL) + if (!name) break; last_name = name;