Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler error #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Commits on Aug 31, 2020

  1. Fix compiler error

    Recent GCC (9.3 at least) got smarter and sees that strncopy should not
    be used with its own length, and memcpy should be used instead. The
    error:
    
    In function strncpy,
        inlined from LoadConfig at ../common/applib.c:127:4:
    /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: __builtin_strncpy output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
      106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../common/applib.c: In function LoadConfig:
    ../common/applib.c:124:15: note: length computed here
      124 |    if ((len = strlen(p)) > CONF_VALUE_LEN)
    tbarbette committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    5216c71 View commit details
    Browse the repository at this point in the history