diff options
author | Kees Cook <keescook@chromium.org> | 2021-06-02 22:29:14 +0200 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2021-06-04 19:21:43 +0200 |
commit | f9ce26c56d37fa6d32f700dfc77f4ceb445ce215 (patch) | |
tree | c568a0bfd717affc70d4d1b7892c1218dd0a5f58 /Documentation/input | |
parent | documentation-file-ref-check: Make git check work for multiple working direct... (diff) | |
download | linux-f9ce26c56d37fa6d32f700dfc77f4ceb445ce215.tar.xz linux-f9ce26c56d37fa6d32f700dfc77f4ceb445ce215.zip |
docs: networking: Replace strncpy() with strscpy()
Replace example code's use of strncpy() with strscpy() functions. Using
strncpy() is considered deprecated:
https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20210602202914.4079123-1-keescook@chromium.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/input')
-rw-r--r-- | Documentation/input/joydev/joystick-api.rst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/input/joydev/joystick-api.rst b/Documentation/input/joydev/joystick-api.rst index af5934c10c1c..5db6dc6fe1c5 100644 --- a/Documentation/input/joydev/joystick-api.rst +++ b/Documentation/input/joydev/joystick-api.rst @@ -263,7 +263,7 @@ possible overrun should the name be too long:: char name[128]; if (ioctl(fd, JSIOCGNAME(sizeof(name)), name) < 0) - strncpy(name, "Unknown", sizeof(name)); + strscpy(name, "Unknown", sizeof(name)); printf("Name: %s\n", name); |