maint: avoid a -Werror=null-dereference with GCC-6.3.1

* src/stty.c (sane_mode): Assert to inform the compiler
we know the pointer will be valid.
This commit is contained in:
Pádraig Brady committed 2017-02-28 19:26:04 -08:00
1 parent b1413b6011
commit 06c3123f6e
1 file changed
+2
+2
View File
@@ -2268,11 +2268,13 @@ sane_mode (struct termios *mode)
if (mode_info[i].flags & SANE_SET)
{
bitsp = mode_type_flag (mode_info[i].type, mode);
assert (bitsp); /* combination modes will not have SANE_SET. */
*bitsp = (*bitsp & ~mode_info[i].mask) | mode_info[i].bits;
}
else if (mode_info[i].flags & SANE_UNSET)
{
bitsp = mode_type_flag (mode_info[i].type, mode);
assert (bitsp); /* combination modes will not have SANE_UNSET. */
*bitsp = *bitsp & ~mode_info[i].mask & ~mode_info[i].bits;
}
}