diff --git a/src/aprs-is.c b/src/aprs-is.c index d170e78..90f87b8 100755 --- a/src/aprs-is.c +++ b/src/aprs-is.c @@ -129,11 +129,13 @@ sendPacket (const char* const restrict server, /* Connect */ char* timeoutText = malloc(BUFSIZE); - sprintf(timeoutText, " (timeout %ld seconds)", timeout); - - if (timeout <= 0) + if (timeout > 0) + { + snprintf(timeoutText, BUFSIZE - 1, " (timeout %ld seconds)", timeout); + } + else { - strncpy(timeoutText, " (no timeout)", BUFSIZE); + snprintf(timeoutText, 14, " (no timeout)"); } switch (addressinfo->sa_family)