diff options
author | Jan Ekström <jeebjp@gmail.com> | 2021-04-05 19:10:35 +0300 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-08-20 20:25:28 +0200 |
commit | 68276e2672bd2422ea6b4be3af4abfa0f1f7f258 (patch) | |
tree | 4d9b5cd451ebca4a967f001491fda4a1c0d99568 /demux/demux_mf.c | |
parent | 034eeaa8d734e914e6065a16323254b5ac039794 (diff) | |
download | mpv-68276e2672bd2422ea6b4be3af4abfa0f1f7f258.tar.bz2 mpv-68276e2672bd2422ea6b4be3af4abfa0f1f7f258.tar.xz |
demux_mf: utilize stdbool bool for if a format specifier was bad
It is not an iterator, thus while the ++ is completely correct,
it is somewhat weird.
Diffstat (limited to 'demux/demux_mf.c')
-rw-r--r-- | demux/demux_mf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/demux/demux_mf.c b/demux/demux_mf.c index 6a6c8c212a..61d06f2c40 100644 --- a/demux/demux_mf.c +++ b/demux/demux_mf.c @@ -16,6 +16,7 @@ */ #include <math.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <strings.h> @@ -153,7 +154,8 @@ static mf_t *open_mf_pattern(void *talloc_ctx, struct demuxer *d, char *filename // simplicity we reject all conversion specifiers except %% and simple // integer specifier: %[.][NUM]d where NUM is 1-3 digits (%.d is valid) const char *f = filename; - int MAXDIGS = 3, nspec = 0, bad_spec = 0, c; + int MAXDIGS = 3, nspec = 0, c; + bool bad_spec = false; while (nspec < 2 && (c = *f++)) { if (c != '%') @@ -177,7 +179,7 @@ static mf_t *open_mf_pattern(void *talloc_ctx, struct demuxer *d, char *filename /* no-op */; if (*f != 'd') { - bad_spec++; // not int, or beyond our validation capacity + bad_spec = true; // not int, or beyond our validation capacity break; } |