pnd_pxml_handle pxmlh = 0;
pnd_pxml_handle *pxmlapps = NULL;
pnd_pxml_handle *pxmlappiter;
- unsigned int pxml_close_pos = 0;
+ off_t pxml_close_pos = 0;
unsigned char logit = pnd_log_do_buried_logging();
if ( logit ) {
pngbuffer [ 4 ] = 13; pngbuffer [ 5 ] = 10; pngbuffer [ 6 ] = 26; pngbuffer [ 7 ] = 10;
unsigned char padtests = 20;
- unsigned int padstart = ftell ( f );
+ off_t padstart = ftello ( f );
// seek back 10 (should be back into the /PXML> part) to catch any appending-icon-no-line-endings funny business
fseek ( f, -10, SEEK_CUR );
if ( fread ( pngbuffer + 8, 8, 1, f ) == 1 ) {
if ( memcmp ( pngbuffer, pngbuffer + 8, 8 ) == 0 ) {
- pxml_close_pos = ftell ( f ) - 8;
+ pxml_close_pos = ftello ( f ) - 8;
break;
} // if
fseek ( f, -7, SEEK_CUR ); // seek back 7 (so we're 1 further than we started, since PNG header is 8b)
if ( ! padtests ) {
// no icon found, so back to where we started looking
- fseek ( f, padstart, SEEK_SET );
+ fseeko ( f, padstart, SEEK_SET );
}
} // icon
p -> subapp_number = ((pnd_pxml_t*) pxmlh) -> subapp_number;
// png icon path
+ p -> pnd_icon_pos64 = pxml_close_pos;
p -> pnd_icon_pos = pxml_close_pos;
+ if ( (off_t) p -> pnd_icon_pos != pxml_close_pos ) {
+ // pnd_icon_pos is an int and the offset doesn't fit, bad luck...
+ p -> pnd_icon_pos = 0;
+ }
// type
p -> object_type = valid;