diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 1996-10-21 08:51:58 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1996-10-21 08:51:58 +0000 |
| commit | bf6570c4a5b48103ded727a6e1e978a1aba20f4e (patch) | |
| tree | 2b586ffb84334821e867f69b5d40bbd9f49dc318 /usr.bin/join | |
| parent | db91faacb6575b5147c6bebd0f6d13587558a2e8 (diff) | |
Notes
Diffstat (limited to 'usr.bin/join')
| -rw-r--r-- | usr.bin/join/join.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/join/join.c b/usr.bin/join/join.c index d717835e7d9d..15d77ff0013b 100644 --- a/usr.bin/join/join.c +++ b/usr.bin/join/join.c @@ -275,7 +275,7 @@ slurp(F) * join field. */ F->setcnt = 0; - for (lastlp = NULL;; ++F->setcnt, lastlp = lp) { + for (lastlp = NULL;; ++F->setcnt) { /* * If we're out of space to hold line structures, allocate * more. Initialize the structure so that we know that this @@ -296,9 +296,10 @@ slurp(F) * the two structures so that we don't lose space allocated to * either structure. This could be avoided by doing another * level of indirection, but it's probably okay as is. - * but it's probably okay as is. */ lp = &F->set[F->setcnt]; + if (F->setcnt) + lastlp = &F->set[F->setcnt - 1]; if (F->pushbool) { tmp = F->set[F->setcnt]; F->set[F->setcnt] = F->set[F->pushback]; |
