aboutsummaryrefslogtreecommitdiff
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index ba6ebd4..8078db0 100644
--- a/lib.c
+++ b/lib.c
@@ -390,6 +390,8 @@ void newfld(int n) /* add field n after end of existing lastfld */
void setlastfld(int n) /* set lastfld cleaning fldtab cells if necessary */
{
+ if (n < 0)
+ FATAL("cannot set NF to a negative value");
if (n > nfields)
growfldtab(n);