This also avoids hardcoding lengths.
Unified · Split
| @@ -903,20 +903,18 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg) · 902 unmodified lines | ||
| 903 | 903 | if (!i && !cmd) { |
| 904 | 904 | flags = 0; /* missing relative prefix, build absolute value */ |
| 905 | 905 | } |
| 906 | − if (!strncmp(token, "repeat", 6)) { | |
| 906 | + if (av_strstart(token, "repeat", &arg)) { | |
| 907 | 907 | if (cmd == '-') { |
| 908 | 908 | flags |= AV_LOG_SKIP_REPEATED; |
| 909 | 909 | } else { |
| 910 | 910 | flags &= ~AV_LOG_SKIP_REPEATED; |
| 911 | 911 | } |
| 912 | − arg = token + 6; | |
| 913 | − } else if (!strncmp(token, "level", 5)) { | |
| 912 | + } else if (av_strstart(token, "level", &arg)) { | |
| 914 | 913 | if (cmd == '-') { |
| 915 | 914 | flags &= ~AV_LOG_PRINT_LEVEL; |
| 916 | 915 | } else { |
| 917 | 916 | flags |= AV_LOG_PRINT_LEVEL; |
| 918 | 917 | } |
| 919 | − arg = token + 5; | |
| 920 | 918 | } else { |
| 921 | 919 | break; |
| 922 | 920 | } |