updated for version 7.3.017
Problem: smatch reports errors.
Solution: Fix the reported errors. (Dominique Pelle)
diff --git a/src/syntax.c b/src/syntax.c
index fbc123c..d2a99a4 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -7600,10 +7600,10 @@
/*
* 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++;