Hello,

I have encountered a piece of code that potentially is incorrect. Can you
please take a look?

vikwebtoolformat.c:223
struct LatLon llpt;
llpt.lat = 0.0;
llpt.lon = 0.0;
if ( vc )
  vik_coord_to_latlon ( vc, &ll );
gchar spointlat[G_ASCII_DTOSTR_BUF_SIZE];
gchar spointlon[G_ASCII_DTOSTR_BUF_SIZE];
g_ascii_dtostr (spointlat, G_ASCII_DTOSTR_BUF_SIZE, llpt.lat);
g_ascii_dtostr (spointlon, G_ASCII_DTOSTR_BUF_SIZE, llpt.lon);

This is a single block of code starting with definition of llpt variable.
The llpt coordinates are set to 0.0/0.0 (initialization), and then
vik_coord_to_latlon() is called. The thing that is strange for me is that
the function is called on ll variable, not on llpt variable.
Later the values of llpt fields (still set to 0.0/0.0) are used to produce
spointlat/spointlon strings.

I understand that maybe we do want spointlat/spointlon to contain
"0.0"/"0.0" strings, but then the call to vik_coord_to_latlon() is
unnecessary.

Is there an error in this code or am I seeing this completely wrong?

Best regards,
Kamil
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to