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

Fixes error reported by -Wformat-truncation #63

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

Conversation

johnlepikhin
Copy link

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wall -Werror -g -O2 -c liboping.c  -fPIC -DPIC -o .libs/liboping_la-liboping.o
liboping.c: In function 'ping_host_add':
liboping.c:207:9: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 243 [-Werror=format-truncation=]
  207 |    "%s: %s", function, message);
      |         ^~
......
 1644 |    ping_set_error (obj, "getaddrinfo", errmsg);
      |                                        ~~~~~~
liboping.c:206:2: note: 'snprintf' output between 14 and 269 bytes into a destination of size 256
  206 |  snprintf (obj->errmsg, sizeof (obj->errmsg),
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  207 |    "%s: %s", function, message);
      |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

liboping.c: In function 'ping_host_add':
liboping.c:207:9: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant