diff --git a/qethqoat/Makefile b/qethqoat/Makefile index 5ac87fb1..80fe56f8 100644 --- a/qethqoat/Makefile +++ b/qethqoat/Makefile @@ -2,7 +2,9 @@ include ../common.mak all: qethqoat -qethqoat: qethqoat.o +libs = $(rootdir)/libutil/libutil.a + +qethqoat: qethqoat.o $(libs) install: all $(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man8 diff --git a/qethqoat/qethqoat.c b/qethqoat/qethqoat.c index 7110c283..96dd4d36 100644 --- a/qethqoat/qethqoat.c +++ b/qethqoat/qethqoat.c @@ -24,6 +24,7 @@ #include #include +#include "lib/util_libc.h" #include "lib/zt_common.h" #include "qethqoat.h" @@ -541,6 +542,7 @@ int main(int argc, char **argv) opts.raw = 0; opts.scope = 1; opts.file = NULL; + opts.ifname = NULL; while ((c = getopt_long(argc, argv, qethqoat_opts_str, qethqoat_opts, &index)) != -1) { @@ -613,7 +615,7 @@ int main(int argc, char **argv) return 1; } - strncpy(ifr.ifr_name, opts.ifname, IFNAMSIZ); + util_strlcpy(ifr.ifr_name, opts.ifname, IFNAMSIZ); oat_data.command = opts.scope; ifr.ifr_ifru.ifru_data = (void *)&oat_data;