aboutsummaryrefslogtreecommitdiff
path: root/src/engine
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-08-09 12:16:04 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2025-08-09 12:16:04 +0530
commit1acd74f76716c078015700b04c5e1c7b1b4f7556 (patch)
treeef18042a3631ecda0cf11f6affd184e50895f931 /src/engine
parent66c403c79e64dbe96fc080ff74e87db2102f93f3 (diff)
lexer,engine: use strlen(content) instead of length
I can't remember why I added length instead of using strlen(content). If this breaks anything it would be a pain to debug. In my little testing though, it seems to be working fine.
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/contentfor.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/engine/contentfor.c b/src/engine/contentfor.c
index a30c3c8..76aae79 100644
--- a/src/engine/contentfor.c
+++ b/src/engine/contentfor.c
@@ -31,9 +31,8 @@ handle_contentfor(char **buffer,
list_t *content_headers)
{
contentfor_operand_t *operand = directive->operands;
- contentfor_operand_t new_operand = { .content = strdup(operand->content),
- .key = strdup(operand->key),
- .length = operand->length };
+ contentfor_operand_t new_operand
+ = { .content = strdup(operand->content), .key = strdup(operand->key) };
list_add(content_headers, &new_operand);
#ifdef DEBUG
@@ -48,7 +47,7 @@ handle_contentfor(char **buffer,
"%.*s%s",
match->offset,
temp_buffer,
- temp_buffer + operand->length);
+ temp_buffer + strlen(operand->content));
free(temp_buffer);
}