From 0450b36c67e59403983d1170058b8fe67c949d8e Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Sun, 25 Dec 2022 22:26:52 -0600 Subject: [PATCH] Fix apex build and warning message https://github.com/Hamlib/Hamlib/issues/1159 --- rotators/apex/Android.mk | 2 +- rotators/apex/Makefile.am | 2 +- rotators/apex/apex.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rotators/apex/Android.mk b/rotators/apex/Android.mk index 99e7cb2d8..1dbeb46f5 100644 --- a/rotators/apex/Android.mk +++ b/rotators/apex/Android.mk @@ -2,7 +2,7 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -LOCAL_SRC_FILES := apex.c sharedloop.c +LOCAL_SRC_FILES := apex.c apex.h sharedloop.c LOCAL_MODULE := apex LOCAL_CFLAGS := diff --git a/rotators/apex/Makefile.am b/rotators/apex/Makefile.am index d575974e5..0af8b6d76 100644 --- a/rotators/apex/Makefile.am +++ b/rotators/apex/Makefile.am @@ -1,5 +1,5 @@ noinst_LTLIBRARIES = libhamlib-apex.la -libhamlib_apex_la_SOURCES = apex.c sharedloop.c +libhamlib_apex_la_SOURCES = apex.c apex.h sharedloop.c EXTRA_DIST = Android.mk diff --git a/rotators/apex/apex.c b/rotators/apex/apex.c index 698b32674..eb6e39b20 100644 --- a/rotators/apex/apex.c +++ b/rotators/apex/apex.c @@ -6,7 +6,7 @@ float apex_azimuth; -char apex_info[64]; +char apex_info[65]; static pthread_t apex_read_thread; @@ -27,7 +27,7 @@ static int apex_get_string(ROT *rot, char *s, int maxlen) retval = read_string(&rs->rotport, (unsigned char *)buf, sizeof(buf), "\n", strlen("\n"), sizeof(buf), 1); - strncpy(s, buf, maxlen); + strncpy(s, buf, 64); strtok(s, "\r\n"); // truncate any CR/LF rig_debug(RIG_DEBUG_VERBOSE, "%s: %d bytes '%s'\n", __func__, retval, s);