various: don't check if endptr is null for strto[udll]

These functions always set endptr to non-null so there is no need to
check.
This commit is contained in:
nanahi authored and Kacper Michajłow committed 2026-04-17 04:09:23 +02:00
1 parent 6260e7236c
commit da2739f44f
6 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -340,7 +340,7 @@ static void resolve_positional_arg(void *avobj, char **name)
char *end = NULL;
int pos = strtol(*name + 1, &end, 10);
if (!end || *end || pos < 0)
if (*end || pos < 0)
return;
const AVOption *opt = NULL;
+1 -1
View File
@@ -2869,7 +2869,7 @@ static int decode_float(char *str, float *out)
float dec_val;
dec_val = strtod(str, &rest);
if (!rest || (rest == str) || !isfinite(dec_val))
if (rest == str || !isfinite(dec_val))
return -1;
*out = dec_val;
+1 -1
View File
@@ -660,7 +660,7 @@ static int dict_get_decimal(AVDictionary *dict, const char *entry, int def)
if (e && e->value) {
char *end = NULL;
long int r = strtol(e->value, &end, 10);
if (end && !end[0] && r >= INT_MIN && r <= INT_MAX)
if (!end[0] && r >= INT_MIN && r <= INT_MAX)
return r;
}
return def;
+1 -1
View File
@@ -1839,7 +1839,7 @@ static void parse_vorbis_chmap(struct mp_chmap *channels, unsigned char *data,
snprintf(smask, sizeof(smask), "%.*s", (int)(len - 34), data + 34);
char *end = NULL;
uint32_t mask = strtol(smask, &end, 0);
if (!end || end[0])
if (end[0])
mask = 0;
struct mp_chmap chmask = {0};
mp_chmap_from_waveext(&chmask, mask);
+1 -1
View File
@@ -786,7 +786,7 @@ static int choice_get(const m_option_t *opt, void *ta_parent,
if (alt) {
char *end = NULL;
ival = strtol(alt->name, &end, 10);
if (end && !end[0])
if (!end[0])
alt = NULL;
}
if (alt) {
+1 -1
View File
@@ -300,7 +300,7 @@ static int open_f(stream_t *stream, const struct stream_open_args *args)
stream->is_local_fs = false;
char *begin = strstr(stream->url, "://") + 3, *end = NULL;
p->fd = strtol(begin, &end, 0);
if (!end || end == begin || end[0] || p->fd < 0) {
if (end == begin || end[0] || p->fd < 0) {
MP_ERR(stream, "Invalid FD number: %s\n", stream->url);
return STREAM_ERROR;
}