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 /driver_nmea0183.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 'driver_nmea0183.c')
-rw-r--r-- | driver_nmea0183.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/driver_nmea0183.c b/driver_nmea0183.c index 30ff3b94..166ba360 100644 --- a/driver_nmea0183.c +++ b/driver_nmea0183.c @@ -1276,7 +1276,7 @@ gps_mask_t nmea_parse(char *sentence, struct gps_device_t * session) /*@ -usedef @*//* splint 3.1.1 seems to have a bug here */ /* make an editable copy of the sentence */ - (void)strlcpy((char *)session->nmea.fieldcopy, sentence, NMEA_MAX); + (void)strlcpy((char *)session->nmea.fieldcopy, sentence, sizeof(session->nmea.fieldcopy) - 1); /* discard the checksum part */ for (p = (char *)session->nmea.fieldcopy; (*p != '*') && (*p >= ' ');) |