[tracker/meegotouch-guess-charset] tracker-extract, mp3: Take into account \0 bytes in the fields



commit dacead859f2fc88913ebbcbb4e83f8bd6a6a08ad
Author: Philip Van Hoof <philip codeminded be>
Date:   Fri Mar 4 14:00:09 2011 +0100

    tracker-extract,mp3: Take into account \0 bytes in the fields

 src/tracker-extract/tracker-extract-mp3.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-mp3.c b/src/tracker-extract/tracker-extract-mp3.c
index 1269fbf..93ccc4d 100644
--- a/src/tracker-extract/tracker-extract-mp3.c
+++ b/src/tracker-extract/tracker-extract-mp3.c
@@ -740,11 +740,11 @@ get_id3 (const gchar *data,
 		gboolean encoding_was_found;
 
 		/* Get the encoding for ALL the data we are extracting here */
-		s = g_string_new_len (pos, 30);
-		g_string_append_len (s, pos + 30, 30);
-		g_string_append_len (s, pos + 60, 30);
-		g_string_append_len (s, pos + 90, (pos[28] != 0) ? 30 : 28);
-		g_string_append_len (s, pos + 120, 30);
+
+		s = g_string_new_len (pos, strnlen (pos, 30));
+		g_string_append_len (s, pos + 30, strnlen (pos+30, 30));
+		g_string_append_len (s, pos + 60, strnlen (pos+60, 30));
+		g_string_append_len (s, pos + 94, strnlen (pos+94, ((pos+94)[28] != 0) ? 30 : 28));
 
 		encoding = get_encoding (s->str, 90, &encoding_was_found);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]