~firmware-testing-team/fwts/master

Viewing all changes in revision 4427.

  • Committer: Alex Hung
  • Author(s): Colin Ian King
  • Date: 2019-11-07 16:40:06 UTC
  • Revision ID: git-v1:ae9e38cdd90946413de0b698ff9888492abdd1c1
lib: fwts_framework: use strlcpy instead of strncpy, fixes gcc-10 build errors

In function ‘fwts_framework_strtrunc’,
    inlined from ‘fwts_framework_minor_test_progress’ at fwts_framework.c:470:3:
fwts_framework.c:374:3: error: ‘strncpy’ output may be truncated copying between 0 and 247 bytes from a string of length 1023 [-Werror=stringop-truncation]
  374 |   strncpy(dest, src, max);
      |   ^~~~~~~~~~~~~~~~~~~~~~~
In function ‘fwts_framework_strtrunc’,
    inlined from ‘fwts_framework_run_test.isra’ at fwts_framework.c:596:4:
fwts_framework.c:374:3: error: ‘strncpy’ specified bound 1024 equals destination size [-Werror=stringop-truncation]
  374 |   strncpy(dest, src, max);
      |   ^~~~~~~~~~~~~~~~~~~~~~~
In function ‘fwts_framework_strtrunc’,
    inlined from ‘fwts_framework_run_test.isra’ at fwts_framework.c:695:4:
fwts_framework.c:374:3: error: ‘strncpy’ specified bound 1024 equals destination size [-Werror=stringop-truncation]
  374 |   strncpy(dest, src, max);
      |   ^~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Alex Hung <alex.hung@canonical.com>
Acked-by: Ivan Hu <ivan.hu@canonical.com>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: