summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2021-06-10 07:58:08 +0000
committernicm <nicm>2021-06-10 07:58:08 +0000
commit8d75542986a54fdedda9d8ad1fc37dd83f7f05c9 (patch)
tree9264ba20c2f8c8ee10996c18784ce2ad48c75150
parent3a5b576399e5f4dff4a975cadb9ef741de8e2011 (diff)
Bump FORMAT_LOOOP_LIMIT and add a log message when hit, GitHub issue 2715.
-rw-r--r--format.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/format.c b/format.c
index 17ce998d..a10af458 100644
--- a/format.c
+++ b/format.c
@@ -103,7 +103,7 @@ format_job_cmp(struct format_job *fj1, struct format_job *fj2)
#define FORMAT_CHARACTER 0x10000
/* Limit on recursion. */
-#define FORMAT_LOOP_LIMIT 10
+#define FORMAT_LOOP_LIMIT 100
/* Format expand flags. */
#define FORMAT_EXPAND_TIME 0x1
@@ -3991,7 +3991,7 @@ format_replace_expression(struct format_modifier *mexp,
result = (mleft < mright);
break;
case LESS_THAN_EQUAL:
- result = (mleft >= mright);
+ result = (mleft <= mright);
break;
}
if (use_fp)
@@ -4441,8 +4441,10 @@ format_expand1(struct format_expand_state *es, const char *fmt)
if (fmt == NULL || *fmt == '\0')
return (xstrdup(""));
- if (es->loop == FORMAT_LOOP_LIMIT)
+ if (es->loop == FORMAT_LOOP_LIMIT) {
+ format_log(es, "reached loop limit (%u)", FORMAT_LOOP_LIMIT);
return (xstrdup(""));
+ }
es->loop++;
format_log(es, "expanding format: %s", fmt);