This also avoids hardcoding lengths. Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com> --- Will apply this tomorrow unless there are objections in order not to block Soft Works' patch.
fftools/cmdutils.c | 6 ++---- 1 file 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; } -- 2.30.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".