On Wed, 9 Jun 2010, Tom Russo wrote:

I'm not sure why xastir_snprintf is preferrable to strncpy for such a
string copy,

Consistency.  If we get used to using xastir_snprintf() then we can
isolate ourselves from string operations that are not safe.  We can
also change the underlying string operations later if we come up
with something better/safer/faster, without having to change
hundreds of lines in Xastir.  That's about it I think.  Not the
strongest argument but still worth it I think.


but doing it with a %s will definitely clear the warning from
later GCC, and will preserve the meaning of the code so long as only the
  xastir_snprintf(destination,length,string_variable)

instances are the ones that are replaced with
  xastir_snprintf(destination,length,"%s",string_variable)

Thanks Tom.

--
Curt, WE7U.                         <http://www.eskimo.com/~archer>
   APRS:  Where it's at!                    <http://www.xastir.org>
  Lotto:  A tax on people who are bad at math. - unknown
Windows:  Microsoft's tax on computer illiterates. - WE7U.
The world DOES revolve around me:  I picked the coordinate system!"
_______________________________________________
Xastir-dev mailing list
[email protected]
http://lists.xastir.org/cgi-bin/mailman/listinfo/xastir-dev

Reply via email to