aboutsummaryrefslogtreecommitdiff
path: root/src/blocks/ram.c
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2024-09-08 22:41:53 +0200
committerFederico Angelilli <code@fedang.net>2024-09-08 22:41:53 +0200
commitf1f89a745fb46c4b387f3cb6c094e9dd38edf9f6 (patch)
treee696fbcd8e3142c7e64e4b1e3148b16f96b79730 /src/blocks/ram.c
parentee8f2ac000a577f20a1a38c5ddd20831a8e38311 (diff)
Add date block
Diffstat (limited to 'src/blocks/ram.c')
-rw-r--r--src/blocks/ram.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/blocks/ram.c b/src/blocks/ram.c
index c6ed727..5a95013 100644
--- a/src/blocks/ram.c
+++ b/src/blocks/ram.c
@@ -64,10 +64,7 @@ static bool block_ram_validate(block_t *block, const block_scheme_t *scheme)
return false;
}
- block->state = block->text.text;
- block->text.text = NULL;
-
- if (strstr(block->state, "%{") == NULL) {
+ if (strstr(block->text.text, "%{") == NULL) {
log_warn("Block '%s' does not use any ram variable", block->label);
block->update_cb = NULL;
@@ -75,6 +72,8 @@ static bool block_ram_validate(block_t *block, const block_scheme_t *scheme)
return true;
}
+ block->state = block->text.text;
+ block->text.text = NULL;
return true;
}
@@ -93,4 +92,3 @@ const block_scheme_t block_ram_scheme = {
.entries = NULL,
.validate = block_ram_validate,
};
-