Commit 3ef9e789 authored by David King's avatar David King Committed by Simon McVittie

is_valid_section_name: Fix logical expression

Group names in desktop files may contain all ASCII characters, except
control characters and '[' and ']'. Rather than accepting all values,
thanks to a logical operator confusion found by GCC warning
-Wlogical-op, instead explicitly reject the invalid values.
Signed-off-by: 's avatarDavid King <dking@redhat.com>
Fixes: #208
parent 5defe7d9
......@@ -382,8 +382,7 @@ is_valid_section_name (const char *name)
while (*name)
{
if (!((*name >= 'A' && *name <= 'Z') || (*name >= 'a' || *name <= 'z') ||
*name == '\n' || *name == '\t'))
if (*name <= 0x1f || *name >= 0x7f || *name == '[' || *name == ']')
return FALSE;
name++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment