bugGPSD - Bugs: bug #44551, libgpsd_core.c:939: possible error...

 
 

bug #44551: libgpsd_core.c:939: possible error in if statement ?

Submitted by:  David Binderman <dcb314>
Submitted on:  Mon 16 Mar 2015 02:15:18 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Eric S. Raymond <esr>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 16 Mar 2015 03:21:13 PM UTC, comment #2:

>Good catch! Fixed.


You are welcome.

>Curiously, fixing this didn't break any of my end-to-end tests.


Might be time for a new test.

BTW, I found this bug by running cppcheck, a static analysis tool,
over the source code of gpsd.

I couldn't find any other problems with gpsd, but cppcheck might
be useful on other softwares.

David Binderman <dcb314>
Mon 16 Mar 2015 02:39:20 PM UTC, comment #1:

Good catch! Fixed.

Curiously, fixing this didn't break any of my end-to-end tests.

Eric S. Raymond <esr>
Project AdministratorIn charge of this item.
Mon 16 Mar 2015 02:15:18 PM UTC, original submission:

[libgpsd_core.c:939] -> [libgpsd_core.c:939]: (style) Same expression on both sides of '&&'.

&& isnan(oldfix->time) == 0 && isnan(oldfix->time) == 0

Maybe better code

&& isnan(oldfix->time) == 0 && isnan(fix->time) == 0

David Binderman <dcb314>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by esr (Posted a comment)
  • -unavailable- added by dcb314 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 03 Jun 2015 02:14:24 PM UTCesrOpen/ClosedOpen=>Closed
    Mon 16 Mar 2015 02:39:20 PM UTCesrStatusNone=>Fixed
      Assigned toNone=>esr

    Back to the top


    Powered by Savane 3.1-cleanup1