summaryrefslogtreecommitdiff
path: root/drivers.c
diff options
context:
space:
mode:
authorZbigniew Chyla <zbigniew.chyla@nsn.com>2015-01-07 11:04:00 +0100
committerEric S. Raymond <esr@thyrsus.com>2015-01-13 07:23:15 -0500
commit18d76d6bda59a9eb0a3f062fac91f481babcbdf4 (patch)
treebedf2bc28676681e73a8decc42c4c757faa47e2e /drivers.c
parent679ad1b39528615dbaeb22bc741b93dc3c3ee4fb (diff)
downloadgpsd-18d76d6bda59a9eb0a3f062fac91f481babcbdf4.tar.gz
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.
Diffstat (limited to 'drivers.c')
-rw-r--r--drivers.c2
1 files changed, 1 insertions, 1 deletions
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)) {