diff options
author | Zbigniew Chyla <zbigniew.chyla@nsn.com> | 2015-01-07 11:04:00 +0100 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-01-13 07:23:15 -0500 |
commit | 18d76d6bda59a9eb0a3f062fac91f481babcbdf4 (patch) | |
tree | bedf2bc28676681e73a8decc42c4c757faa47e2e /net_ntrip.c | |
parent | 679ad1b39528615dbaeb22bc741b93dc3c3ee4fb (diff) | |
download | gpsd-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 'net_ntrip.c')
-rw-r--r-- | net_ntrip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net_ntrip.c b/net_ntrip.c index 47bdb636..be8db7ca 100644 --- a/net_ntrip.c +++ b/net_ntrip.c @@ -164,7 +164,7 @@ static int ntrip_sourcetable_parse(struct gps_device_t *device) bool sourcetable = false; bool match = false; char buf[BUFSIZ]; - size_t blen = BUFSIZ; + size_t blen = sizeof(buf); int fd = device->gpsdata.gps_fd; for (;;) { @@ -547,7 +547,7 @@ int ntrip_open(struct gps_device_t *device, char *caster) return ret; } (void)close(device->gpsdata.gps_fd); - if (ntrip_auth_encode(&device->ntrip.stream, device->ntrip.stream.credentials, device->ntrip.stream.authStr, 128) != 0) { + if (ntrip_auth_encode(&device->ntrip.stream, device->ntrip.stream.credentials, device->ntrip.stream.authStr, sizeof(device->ntrip.stream.authStr)) != 0) { device->ntrip.conn_state = ntrip_conn_err; return -1; } |