From 18d76d6bda59a9eb0a3f062fac91f481babcbdf4 Mon Sep 17 00:00:00 2001 From: Zbigniew Chyla Date: Wed, 7 Jan 2015 11:04:00 +0100 Subject: Always use sizeof to get array size Don't use constant/expression from an array's definition when referring to its size. Eliminates redundancy and avoids problems when array size changes. The change doesn't affect generated code. --- drivers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers.c') diff --git a/drivers.c b/drivers.c index 5537553a..60304938 100644 --- a/drivers.c +++ b/drivers.c @@ -805,7 +805,7 @@ static int oceanserver_send(struct gpsd_errout_t *errout, va_start(ap, fmt); (void)vsnprintf(buf, sizeof(buf) - 5, fmt, ap); va_end(ap); - (void)strlcat(buf, "", BUFSIZ); + (void)strlcat(buf, "", sizeof(buf)); status = (int)write(fd, buf, strlen(buf)); (void)tcdrain(fd); if (status == (int)strlen(buf)) { -- cgit v1.2.1