From dcf4ca6104c1085214bc110f0bb636fed0f64019 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Mon, 24 Oct 2016 00:03:48 +0100 Subject: [PATCH] Use LEN() to save having to consider the -1. --- uip/popsbr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/uip/popsbr.c b/uip/popsbr.c index 8d2cf9d7..54aa3684 100644 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -15,7 +15,6 @@ #include #define TRM "." -#define TRMLEN (sizeof TRM - 1) static int poprint = 0; @@ -686,14 +685,14 @@ vcommand (const char *fmt, va_list ap) int multiline (void) { - char buffer[BUFSIZ + TRMLEN]; + char buffer[BUFSIZ + LEN(TRM)]; if (pop_getline (buffer, sizeof buffer, nsc) != OK) return NOTOK; if (HasPrefix(buffer, TRM)) { - if (buffer[TRMLEN] == 0) + if (buffer[LEN(TRM)] == 0) return DONE; - strncpy (response, buffer + TRMLEN, sizeof(response)); + strncpy (response, buffer + LEN(TRM), sizeof(response)); } else strncpy (response, buffer, sizeof(response)); -- 2.56.0