getdata: stop looking after interesting field

The nth_field function continued looking for words after they where known
not to be interesting.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-11-09 22:34:14 +00:00
parent 5f59daa692
commit b918e9157d

View file

@ -188,6 +188,8 @@ int nth_field(int n, char *restrict dest, const char *restrict src)
} else {
if (j == 0) {
wordn++;
if (n + 1 < wordn)
break;
}
if (wordn == n) {
dest[j] = src[i];