mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 08:16:59 +00:00
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:
parent
5f59daa692
commit
b918e9157d
1 changed files with 2 additions and 0 deletions
|
|
@ -188,6 +188,8 @@ int nth_field(int n, char *restrict dest, const char *restrict src)
|
||||||
} else {
|
} else {
|
||||||
if (j == 0) {
|
if (j == 0) {
|
||||||
wordn++;
|
wordn++;
|
||||||
|
if (n + 1 < wordn)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (wordn == n) {
|
if (wordn == n) {
|
||||||
dest[j] = src[i];
|
dest[j] = src[i];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue