aboutsummaryrefslogtreecommitdiff
path: root/src/format.c
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2024-11-18 23:19:32 +0100
committerFederico Angelilli <code@fedang.net>2024-11-18 23:19:32 +0100
commit38637de243c569c0d6aaff455752e617c30c5866 (patch)
tree079da5bf606b4fa6f5be2c4afff1b09af4dc79e6 /src/format.c
parentad0577c0a50013b5cb8105380cba1be06f50df50 (diff)
Fix format and add it to ram
Diffstat (limited to 'src/format.c')
-rw-r--r--src/format.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/format.c b/src/format.c
index 47426ec..4657359 100644
--- a/src/format.c
+++ b/src/format.c
@@ -31,8 +31,9 @@ bool format_init(format_t *format, const char *string, char delim)
// TODO: Escape formatting
if (string[end + 1] == '{') {
+ format_grow();
+
if (start != end) {
- format_grow();
parts[n] = strslice(string, start, end);
marks[n] = false;
n++;
@@ -70,7 +71,7 @@ bool format_init(format_t *format, const char *string, char delim)
next:
}
- if (string[end] != '\0') {
+ if (start != end || string[end] != '\0') {
while (string[end] != '\0') end++;
format_grow();
@@ -108,7 +109,7 @@ bool format_remark(format_t *format, const char *label, const format_pair_t *pai
errors++;
if (label != NULL)
- log_error("Unknown format option '%s' for %s", format->parts[i], label);
+ log_error("Unknown format option '%s' for block '%s'", format->parts[i], label);
next:
}