fixes tag utility cpp
authorPeng Wu <alexepico@gmail.com>
Tue, 24 May 2011 02:40:22 +0000 (10:40 +0800)
committerPeng Wu <alexepico@gmail.com>
Tue, 24 May 2011 02:40:22 +0000 (10:40 +0800)
src/storage/tag_utility.cpp

index dc1f520d54d693dcdbd1235c67ef19c39233d479..69b163ba50c1f2adf87e022286c52435504b5b8f 100644 (file)
@@ -319,9 +319,9 @@ static phrase_token_t taglib_special_string_to_token(const char * string){
 
     const token_pair * pair = tokens;
     while (pair->string) {
-        if ( strcmp(string, pair->string ) == 0 ){
+        if ( strcmp(string, pair->string ) == 0 )
             return pair->token;
-        }
+        pair++;
     }
 
     fprintf(stderr, "error: unknown token:%s.\n", string);
@@ -359,6 +359,7 @@ static const char * taglib_special_token_to_string(phrase_token_t token){
     while (pair->token) {
         if ( token == pair->token )
             return pair->string;
+        pair++;
     }
 
     fprintf(stderr, "error: unknown token:%d.\n", token);