diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-10 20:19:25 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-11 16:24:36 +0200 |
commit | c66bb56d9aa819ff952eb7159d014c7c3265016a (patch) | |
tree | 875d5a9b7add0f53957912567577820e11a0ff4f /fftools/cmdutils.c | |
parent | 4b3906bd7e211f2681bee6b2bb650648a0a04c35 (diff) | |
download | ffmpeg-c66bb56d9aa819ff952eb7159d014c7c3265016a.tar.gz |
fftools/cmdutils: Use av_strstart() instead of strncmp()
This also avoids hardcoding lengths.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'fftools/cmdutils.c')
-rw-r--r-- | fftools/cmdutils.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 64237a4796..6d0bcd6085 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -903,20 +903,18 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg) if (!i && !cmd) { flags = 0; /* missing relative prefix, build absolute value */ } - if (!strncmp(token, "repeat", 6)) { + if (av_strstart(token, "repeat", &arg)) { if (cmd == '-') { flags |= AV_LOG_SKIP_REPEATED; } else { flags &= ~AV_LOG_SKIP_REPEATED; } - arg = token + 6; - } else if (!strncmp(token, "level", 5)) { + } else if (av_strstart(token, "level", &arg)) { if (cmd == '-') { flags &= ~AV_LOG_PRINT_LEVEL; } else { flags |= AV_LOG_PRINT_LEVEL; } - arg = token + 5; } else { break; } |