]> git.itanic.dy.fi Git - maemo-mapper/blobdiff - src/util.c
Corrected conversion to British National Grid
[maemo-mapper] / src / util.c
index 16f04be602860a61e6ac4536b95eefea7140a726..95cdadb2159ae5a40276b32c71bca84a77a64131 100644 (file)
@@ -602,13 +602,9 @@ gboolean convert_os_grid_to_bng(gint easting, gint northing, gchar* bng)
        snprintf(eing, 12, "%u", easting);
        snprintf(ning, 12, "%u", northing);
        
-       gint lnth = strlen(eing);
-       // Note - we only want 4 numbers
-       snprintf(eing, 5, "%s", eing+(lnth-5));
-       
-       lnth = strlen(ning);
-       snprintf(ning, 5, "%s", ning+(lnth-5));
-       
+       snprintf(eing, 5, "%s", eing+1);
+       snprintf(ning, 5, "%s", ning+1);
+               
        sprintf(bng, "%c%c%s%s", 
                        (char)(tmp + 65), 
                        (char)(eX + 65),