Re: [PATCH v2 1/2] libexfat: remove use of sscanf()
David Timber <[email protected]>
| Newsgroups | dev.linux.lists.exfat |
|---|---|
| Message-ID | <[email protected]> |
On 8/21/26 15:46, Namjae Jeon wrote:
>> 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!
>
My intention was to accept negative values as well, but I guess it
doesn't really matter.
All good!