diff options
| author | Guenter Roeck <[email protected]> | 2018-07-01 13:57:24 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2018-07-02 10:39:06 +0200 |
| commit | fd29edc7232bc19f969e8f463138afc5472b3d5f (patch) | |
| tree | 9c91da0f180ad2213d8e7f48dd07b0c7be31b152 /tools/perf/scripts/python/net_dropmonitor.py | |
| parent | 9a69f5087ccc20bb411025decab455836df04168 (diff) | |
staging: speakup: Replace strncpy with memcpy
gcc 8.1.0 generates the following warnings.
drivers/staging/speakup/kobjects.c: In function 'punc_store':
drivers/staging/speakup/kobjects.c:522:2: warning:
'strncpy' output truncated before terminating nul
copying as many bytes from a string as its length
drivers/staging/speakup/kobjects.c:504:6: note: length computed here
drivers/staging/speakup/kobjects.c: In function 'synth_store':
drivers/staging/speakup/kobjects.c:391:2: warning:
'strncpy' output truncated before terminating nul
copying as many bytes from a string as its length
drivers/staging/speakup/kobjects.c:388:8: note: length computed here
Using strncpy() is indeed less than perfect since the length of data to
be copied has already been determined with strlen(). Replace strncpy()
with memcpy() to address the warning and optimize the code a little.
Signed-off-by: Guenter Roeck <[email protected]>
Reviewed-by: Samuel Thibault <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions