Re: [PATCH v2 1/2] libexfat: remove use of sscanf()
Namjae Jeon <[email protected]>
| Newsgroups | dev.linux.lists.exfat |
|---|---|
| Message-ID | <CAKYAXd9FWrUtr6b-0fqwgxMKM3XQStsu9BZxfYmotVtFVFimTw@mail.gmail.com> |
> diff --git a/lib/libexfat.c b/lib/libexfat.c
> index ff0b25b..9cbb17f 100644
> --- a/lib/libexfat.c
> +++ b/lib/libexfat.c
> @@ -167,9 +167,9 @@ static int get_intbool_envvar(const char *name)
> const char *env = getenv(name);
>
> if (env != NULL) {
> - int v = -1;
> + long v = -1;
>
> - if (sscanf(env, "%d", &v) == 1)
> + if (exfat_parse_long(env, &v) == 0)
I have updated this line like the following one.
+ if (exfat_parse_long(env, &v) == 0 && v >= 0)
And I will apply this patch if you don't object to it.
Thanks!