]> git.street.me.uk Git - andy/viking.git/commitdiff
Fix a crash bug caused by operation on variable inside a macro.
authorQuy Tonthat <qtonthat@gmail.com>
Tue, 9 Oct 2007 00:52:02 +0000 (00:52 +0000)
committerQuy Tonthat <qtonthat@gmail.com>
Tue, 9 Oct 2007 00:52:02 +0000 (00:52 +0000)
Crashes was reported on system with x86_64/gcc 4.2 but seems OK on i386/gcc 4.1
On gcc 4.2, a compiler warning was always given.
On gcc 4.1 the flag O2 suppressed the warning.

Signed-off-by: Quy Tonthat <qtonthat@gmail.com>
src/dem.c

index 6701489800a230d88ba3bef9287921139dea77d9..6fa862fc82452fc1b6ac573115a26f7fd43fa35d 100644 (file)
--- a/src/dem.c
+++ b/src/dem.c
@@ -365,7 +365,8 @@ static VikDEM *vik_dem_read_srtm_hgt(FILE *f, const gchar *basename, gboolean zi
   int ent = 0;
   for ( i = (num_rows - 1); i >= 0; i-- ) {
     for ( j = 0; j < num_rows; j++ ) {
-      GET_COLUMN(dem,j)->points[i] = GINT16_FROM_BE(dem_mem[ent++]);
+      GET_COLUMN(dem,j)->points[i] = GINT16_FROM_BE(dem_mem[ent]);
+      ent++;
     }
 
   }