diff options
author | Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> | 2018-06-16 21:34:29 -0300 |
---|---|---|
committer | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2018-06-21 15:46:52 +0300 |
commit | afff8ad2f1ef546026533e1defaddca946d46050 (patch) | |
tree | 9891a61d494a526dbc3bfb520add3de7ee9fc11a /lib/igt_sysrq.c | |
parent | 04afec3ccfcb35e994f2e78254ff499f6b94f097 (diff) |
Account for NULL character when using strncpy
This patch fix the following gcc warning:
warning: ‘strncpy’ specified bound 32 equals destination size
[-Wstringop-truncation]
strncpy(data->name, name, PARAM_NAME_MAX_SZ);
This error happens due to the '\0' character appended by strncpy. Notice
that reduces by one in the total of bytes to be copied, in this case, is
harmless because the strings received in the parameter already have
'\0'.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'lib/igt_sysrq.c')
0 files changed, 0 insertions, 0 deletions