Skip to content
Commit cc89fd77 authored by Wenlin Kang's avatar Wenlin Kang Committed by Bruce Ashfield
Browse files

ext4: fix -Wstringop-truncation warnings



The strncpy() function may create a unterminated string,
use strscpy_pad() instead.

This fixes the following warning:

fs/ext4/super.c: In function '__save_error_info':
fs/ext4/super.c:368:2: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
  strncpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ext4/super.c:373:3: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
   strncpy(es->s_first_error_func, func,
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sizeof(es->s_first_error_func));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: default avatarWenlin Kang <wenlin.kang@windriver.com>
Signed-off-by: default avatarBruce Ashfield <bruce.ashfield@gmail.com>
parent 52b840af
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment