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



commit 02e027e5aacef5463913b07da4022a95d476b59b
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]