summaryrefslogtreecommitdiff
path: root/src/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/syntax.c b/src/syntax.c
index fbc123cc1..d2a99a4f7 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -7600,10 +7600,10 @@ do_highlight(line, forceit, init)
/*
* Copy characters from arg[] to buf[], translating <> codes.
*/
- for (p = arg, off = 0; off < 100 && *p; )
+ for (p = arg, off = 0; off < 100 - 6 && *p; )
{
len = trans_special(&p, buf + off, FALSE);
- if (len) /* recognized special char */
+ if (len > 0) /* recognized special char */
off += len;
else /* copy as normal char */
buf[off++] = *p++;