[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gpsd-dev
Subject:    [Gpsd-dev] xgps.c bugfix
From:       esr () thyrsus ! com (Eric S !  Raymond)
Date:       2005-01-19 18:48:38
Message-ID: 20050119184838.GA10914 () thyrsus ! com
[Download RAW message or body]

Remco Treffkorn <remco@rvt.com>:
> On Wednesday 19 January 2005 06:20, Norbert Federa wrote:
> > reason:
> > below there is the loop:
> >       for (i = 0; i < MAXCHANNELS; i++) {
> >          ...
> >          string[i+1] = ....
> >       }
> >
> > MAXCHANNELS is defined as 12 in gps.h
> > thus this results in assigning string[12] :)
> 
> This also means string[0] is not assigned.
> Why is this offset by one done? Can't we
> just get rid of the +1?

No.  Look at xgps.c:230:

    string[0] = XmStringCreateSimple("PRN:  Elev:  Azim:  SNR:  Used:");

It sets the table header.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic