if (!wcurr)
break;
+ if (!wcurr->point)
+ break;
+
unit2latlon(wcurr->point->unitx, wcurr->point->unity, lat2, lon2);
g_snprintf(buffer1, sizeof(buffer1), "%.05f,%.05f", lat2, lon2);
sum += calculate_distance(lat1, lon1, lat2, lon2);
#include <gtk/gtk.h>
#define MACRO_PATH_INIT(path) { \
- (path).head = (path).tail = g_new(Point, ARRAY_CHUNK_SIZE); \
+ (path).head = (path).tail = g_new0(Point, ARRAY_CHUNK_SIZE); \
*((path).tail) = _point_null; \
(path).cap = (path).head + ARRAY_CHUNK_SIZE; \
- (path).whead = g_new(WayPoint, ARRAY_CHUNK_SIZE); \
+ (path).whead = g_new0(WayPoint, ARRAY_CHUNK_SIZE); \
(path).wtail = (path).whead - 1; \
(path).wcap = (path).whead + ARRAY_CHUNK_SIZE; \
}