[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r4249 - Extractor/src/plugins
From: |
cyberix |
Subject: |
[GNUnet-SVN] r4249 - Extractor/src/plugins |
Date: |
Sun, 7 Jan 2007 07:49:41 -0800 (PST) |
Author: cyberix
Date: 2007-01-07 07:49:37 -0800 (Sun, 07 Jan 2007)
New Revision: 4249
Modified:
Extractor/src/plugins/nsfeextractor.c
Log:
Cleared out a bit.
Modified: Extractor/src/plugins/nsfeextractor.c
===================================================================
--- Extractor/src/plugins/nsfeextractor.c 2007-01-07 13:55:40 UTC (rev
4248)
+++ Extractor/src/plugins/nsfeextractor.c 2007-01-07 15:49:37 UTC (rev
4249)
@@ -61,16 +61,14 @@
{
int i, value = 0;
- for( i = 3; i >= 0 ; i-- )
+ for( i = 3; i > 0 ; i-- )
{
- value += ( unsigned char ) data[ i ];
-
- if( i > 0 )
- {
- value *= 0x100;
- }
+ value += ( unsigned char ) data[ i ];
+ value *= 0x100;
}
+ value += ( unsigned char ) data[ 0 ];
+
return( value );
}
@@ -202,14 +200,15 @@
)
{
char * title;
- int left = size;
+ int left, length;
- while( left > 0 )
+ for( left = size; left > 0; left -= length )
{
title = nsfestring( &data[ size - left ], left );
prev = addkword( prev, title, EXTRACTOR_TITLE );
- left -= ( strlen( title ) + 1 );
+ length = strlen( title ) + 1;
+
free(title);
}
@@ -239,6 +238,7 @@
left -= ( strlen( album ) + 1 );
free(album);
+
if( left < 1 )
{
return( prev );
@@ -249,6 +249,7 @@
left -= ( strlen( artist ) + 1 );
free(artist);
+
if( left < 1 )
{
return( prev );
@@ -259,6 +260,7 @@
left -= ( strlen( copyright ) + 1 );
free(copyright);
+
if( left < 1 )
{
return( prev );
@@ -267,6 +269,7 @@
ripper = nsfestring( &data[ size - left ], left );
prev = addkword( prev, ripper, EXTRACTOR_RIPPER );
free(ripper);
+
return( prev );
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r4249 - Extractor/src/plugins,
cyberix <=