mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
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:
1 parent
b1413b6011
commit
06c3123f6e
1 file changed
+2
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user