1836 char szErrorMsg[160];
1843 if( hEntity < 0 || hEntity >= psSHP->
nRecords )
1851 unsigned int nOffset, nLength;
1858 snprintf(
str,
sizeof(
str),
1859 "Error in fseek()/fread() reading object from .shx file at offset %d",
1861 str[
sizeof(
str)-1] =
'\0';
1869 if( nOffset >
STATIC_CAST(
unsigned int, INT_MAX) )
1872 snprintf(
str,
sizeof(
str),
1873 "Invalid offset for entity %d", hEntity);
1874 str[
sizeof(
str)-1] =
'\0';
1879 if( nLength >
STATIC_CAST(
unsigned int, INT_MAX / 2 - 4) )
1882 snprintf(
str,
sizeof(
str),
1883 "Invalid length for entity %d", hEntity);
1884 str[
sizeof(
str)-1] =
'\0';
static void SwapWord(int length, void *wordP)
#define STATIC_CAST(type, x)
void(* Error)(const char *message)
SAOffset(* FRead)(void *p, SAOffset size, SAOffset nmemb, SAFile file)
SAOffset(* FSeek)(SAFile file, SAOffset offset, int whence)
unsigned int * panRecSize
unsigned int * panRecOffset