From 5bd8eac8ba7f87f34c81cd807b840e427fd96bc1 Mon Sep 17 00:00:00 2001 From: camel Date: Tue, 30 Dec 2008 21:54:26 +0000 Subject: [PATCH] Corrected conversion to British National Grid git-svn-id: svn+ssh://garage/var/lib/gforge/svnroot/maemo-mapper/trunk@233 6c538b50-5814-0410-93ad-8bdf4c0149d1 --- src/util.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/util.c b/src/util.c index 16f04be..95cdadb 100644 --- a/src/util.c +++ b/src/util.c @@ -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), -- 2.44.0