Commit 95aa77a
committed
Use rtapi_strlcpy() instead of strncpy() to avoid compiler warning
The rtapi_strlcpy() method is already used elsewhere in the file, so this
do not introduce a new dependency. This fixes the following compiler
warning:
Compiling libnml/rcs/rcs_print.cc
In file included from /usr/include/string.h:495,
from libnml/rcs/rcs_print.cc:21:
In function ‘char* strncpy(char*, const char*, size_t)’,
inlined from ‘int rcs_vprint(const char*, __va_list_tag*, int)’ at libnml/rcs/rcs_print.cc:311:9:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output may be truncated copying 99 bytes from a string of length 255 [-Wstringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Adjust size from 99 to 100, to match strlcpy() sematics and the 100 byte
size of last_error_bufs[][].1 parent bd3b279 commit 95aa77a
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
| 311 | + | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| |||
0 commit comments