gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] [PATCH] Add Windows versions of time related functions.


From: Gary E. Miller
Subject: Re: [gpsd-dev] [PATCH] Add Windows versions of time related functions.
Date: Wed, 23 Mar 2016 17:28:56 -0700

Yo Robert!

On Wed, 23 Mar 2016 23:56:19 +0000
Robert Norris <address@hidden> wrote:

> > Since the input (isotime) is a fixed length string it would be
> > easy to get rid of the malloc(). Or, even better, there was never
> > any reason to duplicate the input string at all. Patches anyone?
> >  
> 
> Quote from hacking.html:
> 
> "The <code>gpsd</code> daemon doesn't (though the client-side code
> does)."
> 
> Since this is only for Windows builds for libgps - it is only for the
> client side thus should be OK.

Yeah, sort of.  Having code serving no purpose is an accident waiting to
happen.  No need for the strdup(), no need even for a strcpy(), just
operating on the passed in string is faster, simpler, clearer and thus
less likely to hide bugs.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        address@hidden  Tel:+1 541 382 8588

Attachment: pgpvDZ3Ld7dwX.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]