Skip to content
  • Wenlin Kang's avatar
    e50e96a0
    ext4: fix -Wstringop-truncation warnings · e50e96a0
    Wenlin Kang authored
    
    
    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:349: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:353: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>
    e50e96a0
    ext4: fix -Wstringop-truncation warnings
    Wenlin Kang authored
    
    
    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:349: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:353: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>
Loading