Browse Source

fftools/cmdutils: Use av_strstart instead of strncmp

It makes the intent clearer and avoids searching for a delimiter
in advance.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
tags/n4.4
Andreas Rheinhardt 4 years ago
parent
commit
bd85c63d1d
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      fftools/cmdutils.c

+ 2
- 4
fftools/cmdutils.c View File

@@ -215,11 +215,9 @@ void show_help_children(const AVClass *class, int flags)

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) {
if (!strncmp(name, po->name, len) && strlen(po->name) == len)
const char *end;
if (av_strstart(name, po->name, &end) && (!*end || *end == ':'))
break;
po++;
}


Loading…
Cancel
Save