#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 $")
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);
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);
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);
}
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);
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 );
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);
}
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);
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);
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);
}
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);
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 );
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);
total_days = total_hours/24;
if (total_days==0) {
- snprintf(buffer,32,"%02d:%02d:%02d", (int)total_hours%24, (int)total_min%60, (int)total_sec%60);
+ g_snprintf(buffer,32,"%02d:%02d:%02d", (int)total_hours%24, (int)total_min%60, (int)total_sec%60);
} else {
- snprintf(buffer,32,"%02dd %02d:%02d:%02d",
+ g_snprintf(buffer,32,"%02dd %02d:%02d:%02d",
(int)total_days, (int)total_hours%24, (int)total_min%60, (int)total_sec%60);
}
tracking_get_attr(tracking, attr_position_speed, &speed_attr, NULL);
tracking_speed = *speed_attr.u.numd;
if( -1 != tracking_speed && -1 != routespeed ) {
- snprintf(text,16,"%s%.0lf",osm_data ? "" : "~",routespeed);
+ g_snprintf(text,16,"%s%.0lf",osm_data ? "" : "~",routespeed);
if( this->speed_exceed_limit_offset+routespeed<tracking_speed &&
(100.0+this->speed_exceed_limit_percent)/100.0*routespeed<tracking_speed ) {
if(this->announce_state==eNoWarn && this->announce_on) {