1838 char szErrorMsg[160];
1845 if( hEntity < 0 || hEntity >= psSHP->
nRecords )
1853 unsigned int nOffset, nLength;
1860 snprintf(
str,
sizeof(
str),
1861 "Error in fseek()/fread() reading object from .shx file at offset %d",
1863 str[
sizeof(
str)-1] =
'\0';
1871 if( nOffset >
STATIC_CAST(
unsigned int, INT_MAX) )
1874 snprintf(
str,
sizeof(
str),
1875 "Invalid offset for entity %d", hEntity);
1876 str[
sizeof(
str)-1] =
'\0';
1881 if( nLength >
STATIC_CAST(
unsigned int, INT_MAX / 2 - 4) )
1884 snprintf(
str,
sizeof(
str),
1885 "Invalid length for entity %d", hEntity);
1886 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