summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/uniq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/uniq.c b/src/uniq.c
index 7bdbc4f86..9c7e37c7b 100644
--- a/src/uniq.c
+++ b/src/uniq.c
@@ -214,7 +214,7 @@ find_field (struct linebuffer const *line)
size_t size = line->length - 1;
size_t i = 0;
- for (count = 0; count < skip_fields; count++)
+ for (count = 0; count < skip_fields && i < size; count++)
{
while (i < size && isblank (to_uchar (lp[i])))
i++;