summaryrefslogtreecommitdiff
path: root/navit/map/shapefile/shpopen.c
diff options
context:
space:
mode:
Diffstat (limited to 'navit/map/shapefile/shpopen.c')
-rw-r--r--navit/map/shapefile/shpopen.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/navit/map/shapefile/shpopen.c b/navit/map/shapefile/shpopen.c
index ba0ae849a..a0bda0dbe 100644
--- a/navit/map/shapefile/shpopen.c
+++ b/navit/map/shapefile/shpopen.c
@@ -230,6 +230,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <glib.h>
SHP_CVSID("$Id: shpopen.c,v 1.59 2008/03/14 05:25:31 fwarmerdam Exp $")
@@ -1566,7 +1567,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
if ( 8 + 4 > nEntitySize )
{
- snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d",
+ g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d",
hEntity, nEntitySize);
psSHP->sHooks.Error( pszErrorMsg );
SHPDestroyObject(psShape);
@@ -1591,7 +1592,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
if ( 40 + 8 + 4 > nEntitySize )
{
- snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d",
+ g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d",
hEntity, nEntitySize);
psSHP->sHooks.Error( pszErrorMsg );
SHPDestroyObject(psShape);
@@ -1623,7 +1624,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
if (nPoints < 0 || nParts < 0 ||
nPoints > 50 * 1000 * 1000 || nParts > 10 * 1000 * 1000)
{
- snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d, nPoints=%d, nParts=%d.",
+ g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d, nPoints=%d, nParts=%d.",
hEntity, nPoints, nParts);
psSHP->sHooks.Error( pszErrorMsg );
SHPDestroyObject(psShape);
@@ -1646,7 +1647,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
}
if (nRequiredSize > nEntitySize)
{
- snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d, nPoints=%d, nParts=%d, nEntitySize=%d.",
+ g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d, nPoints=%d, nParts=%d, nEntitySize=%d.",
hEntity, nPoints, nParts, nEntitySize);
psSHP->sHooks.Error( pszErrorMsg );
SHPDestroyObject(psShape);
@@ -1670,7 +1671,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
psShape->panPartStart == NULL ||
psShape->panPartType == NULL)
{
- snprintf(pszErrorMsg, 128,
+ g_snprintf(pszErrorMsg, 128,
"Not enough memory to allocate requested memory (nPoints=%d, nParts=%d) for shape %d. "
"Probably broken SHP file", hEntity, nPoints, nParts );
psSHP->sHooks.Error( pszErrorMsg );
@@ -1693,7 +1694,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
if (psShape->panPartStart[i] < 0 ||
psShape->panPartStart[i] >= psShape->nVertices)
{
- snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : panPartStart[%d] = %d, nVertices = %d",
+ g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : panPartStart[%d] = %d, nVertices = %d",
hEntity, i, psShape->panPartStart[i], psShape->nVertices);
psSHP->sHooks.Error( pszErrorMsg );
SHPDestroyObject(psShape);
@@ -1701,7 +1702,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
}
if (i > 0 && psShape->panPartStart[i] <= psShape->panPartStart[i-1])
{
- snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : panPartStart[%d] = %d, panPartStart[%d] = %d",
+ g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : panPartStart[%d] = %d, panPartStart[%d] = %d",
hEntity, i, psShape->panPartStart[i], i - 1, psShape->panPartStart[i - 1]);
psSHP->sHooks.Error( pszErrorMsg );
SHPDestroyObject(psShape);
@@ -1803,7 +1804,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
if ( 44 + 4 > nEntitySize )
{
- snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d",
+ g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d",
hEntity, nEntitySize);
psSHP->sHooks.Error( pszErrorMsg );
SHPDestroyObject(psShape);
@@ -1815,7 +1816,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
if (nPoints < 0 || nPoints > 50 * 1000 * 1000)
{
- snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nPoints = %d",
+ g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nPoints = %d",
hEntity, nPoints);
psSHP->sHooks.Error( pszErrorMsg );
SHPDestroyObject(psShape);
@@ -1829,7 +1830,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
}
if (nRequiredSize > nEntitySize)
{
- snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nPoints = %d, nEntitySize = %d",
+ g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nPoints = %d, nEntitySize = %d",
hEntity, nPoints, nEntitySize);
psSHP->sHooks.Error( pszErrorMsg );
SHPDestroyObject(psShape);
@@ -1847,7 +1848,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
psShape->padfZ == NULL ||
psShape->padfM == NULL)
{
- snprintf(pszErrorMsg, 128,
+ g_snprintf(pszErrorMsg, 128,
"Not enough memory to allocate requested memory (nPoints=%d) for shape %d. "
"Probably broken SHP file", hEntity, nPoints );
psSHP->sHooks.Error( pszErrorMsg );
@@ -1941,7 +1942,7 @@ SHPReadObject( SHPHandle psSHP, int hEntity )
if (20 + 8 + (( psShape->nSHPType == SHPT_POINTZ ) ? 8 : 0)> nEntitySize)
{
- snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d",
+ g_snprintf(pszErrorMsg, 128, "Corrupted .shp file : shape %d : nEntitySize = %d",
hEntity, nEntitySize);
psSHP->sHooks.Error( pszErrorMsg );
SHPDestroyObject(psShape);