summaryrefslogtreecommitdiff
path: root/timebase.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-04-30 23:04:53 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-04-30 23:05:37 -0400
commit321c7710c3f3a17d56e9e5eede9aebadbaf16e3e (patch)
treefae8712111ede1cd948e8846a3bbdafeb8dfd45a /timebase.c
parent5aa7ce8d00de15c832ab90113ef5b08221746e7f (diff)
downloadgpsd-321c7710c3f3a17d56e9e5eede9aebadbaf16e3e.tar.gz
Fix static-checker warnings. All regression tests pass.
cppchecker now finds variables that could have reduced scope; that's most of these.
Diffstat (limited to 'timebase.c')
-rw-r--r--timebase.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/timebase.c b/timebase.c
index 38b6e951..28ed42b9 100644
--- a/timebase.c
+++ b/timebase.c
@@ -135,11 +135,10 @@ void gpsd_set_century(struct gps_device_t *session)
* started up in.
*/
{
- unsigned char *cp;
char *end;
if (strstr((char *)session->packet.outbuffer, "Date:") != NULL) {
int year;
- cp = session->packet.outbuffer + 5;
+ unsigned char *cp = session->packet.outbuffer + 5;
while (isspace(*cp))
--cp;
year = (int)strtol((char *)cp, &end, 10);