Sure, I know it will accept any whitespace characted, not just spaces.
But no whitespace character is allowed to be in a DNS name. Let alone
begin with it. These spaces can be in configuration file, where TAB is
not unusual thing. I want any of them to be ignored. If they are not,
dnsmasq will refuse to start, telling you CNAME is invalid. No, just
wrong space is there. I think it is ok in this case to allow any space
that current locale knows about. It would not allow special unicode
spaces anyway, because they will not fit into single char.

Dne 26.2.2018 v 20:37 Pali Rohár napsal(a):
> On Monday 26 February 2018 19:59:53 Petr Menšík wrote:
>> -        for (arg += strlen(arg)+1; *arg == ' '; arg++);
>> +        for (arg += arglen+1; *arg && isspace(*arg); arg++);
> 
> Hi!
> 
> Just one note about this change. Function isspace() is implemented
> according to current locale and basically every locale can have
> different set of characters marked as "space". E.g. in C locale
> isspace() function is truth not only for ASCII space (0x20), but also
> e.g. for ASCII tab (0x09). Some people improperly use function isspace()
> just because they think it matches only ASCII spaces (0x20).
> 
> Due to dependent on locale I would suggest to use explicit set of
> characters... but that is just suggestion.
> 

-- 
Petr Menšík
Software Engineer
Red Hat, http://www.redhat.com/
email: pemen...@redhat.com  PGP: 65C6C973

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

Reply via email to