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 )
{
case -1:
state = 4;
break;
- case 0:
- state = 2;
- break;
default:
state = 3;
}
switch(extract_string(line, tmp, sizeof(tmp)))
{
case -1:
- state = 4;
+ state = 2;
break;
default:
strcat(key, tmp);
strcat(val, tmp);
}
}
- else if( state == 4 )
+
+ if( state == 4 )
{
if( strlen(key) > 0 && strlen(val) > 0 )
{