diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-11-01 17:27:56 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-11-01 17:27:56 +0000 |
commit | 58ba2de8e108b8223d55cfb85fa41dadeb049627 (patch) | |
tree | 500fe9ff94e8efc5f0d07e388138f10944ac5ae1 /libs/lmo/src/lmo_po2lmo.c | |
parent | 249ebe3622a766fd2b36effcbe49ea1ae4c6a53a (diff) |
libs/lmo: fix logic errors in po2lmo
Diffstat (limited to 'libs/lmo/src/lmo_po2lmo.c')
-rw-r--r-- | libs/lmo/src/lmo_po2lmo.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libs/lmo/src/lmo_po2lmo.c b/libs/lmo/src/lmo_po2lmo.c index 9b7b09792f..afe894e8e0 100644 --- a/libs/lmo/src/lmo_po2lmo.c +++ b/libs/lmo/src/lmo_po2lmo.c @@ -99,7 +99,7 @@ int main(int argc, char *argv[]) memset(key, 0, sizeof(val)); memset(val, 0, sizeof(val)); - while( (NULL != fgets(line, sizeof(line), in)) || (state >= 3 && feof(in)) ) + while( (NULL != fgets(line, sizeof(line), in)) || (state >= 2 && feof(in)) ) { if( state == 0 && strstr(line, "msgid \"") == line ) { @@ -123,9 +123,6 @@ int main(int argc, char *argv[]) case -1: state = 4; break; - case 0: - state = 2; - break; default: state = 3; } @@ -135,7 +132,7 @@ int main(int argc, char *argv[]) switch(extract_string(line, tmp, sizeof(tmp))) { case -1: - state = 4; + state = 2; break; default: strcat(key, tmp); @@ -153,7 +150,8 @@ int main(int argc, char *argv[]) strcat(val, tmp); } } - else if( state == 4 ) + + if( state == 4 ) { if( strlen(key) > 0 && strlen(val) > 0 ) { |