]> git.ipfire.org Git - thirdparty/mtr.git/commit
build: fix compiler warnings when for OpenBSD, NetBSD and Solaris 175/head
authorMatt Kimball <matt.kimball@gmail.com>
Fri, 30 Dec 2016 16:32:45 +0000 (16:32 +0000)
committerMatt Kimball <matt.kimball@gmail.com>
Fri, 30 Dec 2016 21:10:28 +0000 (13:10 -0800)
commit54294e8c28de82d8b5587957e53d9febdb343fe5
tree8ce0cb13d1c8c25fe1caaab8ccc68470cad773d3
parentf19df41bba10b570b06383e5cd6e00b85d9bc3bc
build: fix compiler warnings when for OpenBSD, NetBSD and Solaris

When building for NetBSD, the compiler was warning about
index into an array with a character when using isspace() and
similar macros.

IPPROTO_SCTP is also not defined by NetBSD, so there were
warnings about unused SCTP related variables.

OpenBSD complains about using sprintf rather than snprintf.
It's a good idea to use snprintf, anyway, to avoid buffer overruns,
though I believe in these particular cases sprintf was safe.
Nevertheless, snprintf is now used instead.

Solaris requires strings.h to find index().

Solaris complaints about a missing sentinel pointer unless
the terminating NULL in execl is cast to a "char *".
12 files changed:
packet/cmdparse.c
packet/command.c
packet/deconstruct_unix.c
packet/probe.c
packet/probe_unix.c
packet/wait_unix.c
ui/asn.c
ui/cmdpipe.c
ui/curses.c
ui/dns.c
ui/split.c
ui/utils.c