summaryrefslogtreecommitdiff
path: root/apps/metadata
diff options
context:
space:
mode:
Diffstat (limited to 'apps/metadata')
-rw-r--r--apps/metadata/metadata_common.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/apps/metadata/metadata_common.c b/apps/metadata/metadata_common.c
index 94ff212cea..09f0f94a88 100644
--- a/apps/metadata/metadata_common.c
+++ b/apps/metadata/metadata_common.c
@@ -29,6 +29,7 @@
29#include "metadata_common.h" 29#include "metadata_common.h"
30#include "metadata_parsers.h" 30#include "metadata_parsers.h"
31#include "replaygain.h" 31#include "replaygain.h"
32#include "misc.h"
32 33
33/* Skip an ID3v2 tag if it can be found. We assume the tag is located at the 34/* Skip an ID3v2 tag if it can be found. We assume the tag is located at the
34 * start of the file, which should be true in all cases where we need to skip it. 35 * start of the file, which should be true in all cases where we need to skip it.
@@ -173,16 +174,6 @@ long get_slong(void* buf)
173 return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24); 174 return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
174} 175}
175 176
176static char* skip_space(char* str)
177{
178 while (isspace(*str))
179 {
180 str++;
181 }
182
183 return str;
184}
185
186unsigned long get_itunes_int32(char* value, int count) 177unsigned long get_itunes_int32(char* value, int count)
187{ 178{
188 static const char hexdigits[] = "0123456789ABCDEF"; 179 static const char hexdigits[] = "0123456789ABCDEF";
@@ -191,7 +182,7 @@ unsigned long get_itunes_int32(char* value, int count)
191 182
192 while (count-- > 0) 183 while (count-- > 0)
193 { 184 {
194 value = skip_space(value); 185 value = skip_whitespace(value);
195 186
196 while (*value && !isspace(*value)) 187 while (*value && !isspace(*value))
197 { 188 {
@@ -199,7 +190,7 @@ unsigned long get_itunes_int32(char* value, int count)
199 } 190 }
200 } 191 }
201 192
202 value = skip_space(value); 193 value = skip_whitespace(value);
203 194
204 while (*value && ((c = strchr(hexdigits, toupper(*value))) != NULL)) 195 while (*value && ((c = strchr(hexdigits, toupper(*value))) != NULL))
205 { 196 {