summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2021-05-19 09:04:45 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2021-06-10 09:23:34 +0100
commitf06ee2b87b88d0889e8dfeb2ae85a2b7d4ce0d49 (patch)
tree0b743037566105665aa93ace17a72a30d2b93c31
parent9b4c05b6b9aec916c0940aa704c5f2ec9e1a8a83 (diff)
Bump FORMAT_LOOOP_LIMIT and add a log message when hit, GitHub issue 2715.
-rw-r--r--format.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/format.c b/format.c
index 6ac086cb..512df009 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
@@ -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);