mmenu; better handling where a suncategory name is available to multiple parent categ...
[pandora-libraries.git] / lib / pnd_discovery.c
index f40e51b..4c2feba 100644 (file)
@@ -129,7 +129,6 @@ static int pnd_disco_callback ( const char *fpath, const struct stat *sb,
 #if 1 // icon
     // for convenience, lets skip along past trailing newlines/CR's in hopes of finding icon data?
     {
-      unsigned int pos = ftell ( f );
       char pngbuffer [ 16 ]; // \211 P N G \r \n \032 \n
       pngbuffer [ 0 ] = 137;      pngbuffer [ 1 ] = 80;      pngbuffer [ 2 ] = 78;      pngbuffer [ 3 ] = 71;
       pngbuffer [ 4 ] = 13;       pngbuffer [ 5 ] = 10;       pngbuffer [ 6 ] = 26;      pngbuffer [ 7 ] = 10;
@@ -144,7 +143,7 @@ static int pnd_disco_callback ( const char *fpath, const struct stat *sb,
 
        if ( fread ( pngbuffer + 8, 8, 1, f ) == 1 ) {
          if ( memcmp ( pngbuffer, pngbuffer + 8, 8 ) == 0 ) {
-           pxml_close_pos = pos;
+           pxml_close_pos = ftell ( 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)