summaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
authormbkma <[email protected]>2025-08-14 17:07:17 +0200
committerLuke from DC <[email protected]>2025-09-21 20:32:12 +0000
commit5660b20ee1a62bc7bf1360686150d7cac8f2e791 (patch)
tree38c048204d2ec0d2332983542a1ec54b3a3833ee /src/parser.c
parent2941cad8aeb8a929d1cf4920d95cf3916b27f856 (diff)
downloadmate-calc-5660b20ee1a62bc7bf1360686150d7cac8f2e791.tar.bz2
mate-calc-5660b20ee1a62bc7bf1360686150d7cac8f2e791.tar.xz
add missing byte in malloc for null terminatorHEADmaster
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/parser.c b/src/parser.c
index d60c142..c9d711b 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -343,7 +343,7 @@ p_check_variable(ParserState* state, gchar* name)
if(utf8_next_char(name)[0] != '\0')
{
result = 1;
- buffer = (gchar*) malloc(sizeof(gchar) * strlen(name));
+ buffer = (gchar*) malloc(sizeof(gchar) * (strlen(name) + 1));
for(c = name; *c != '\0'; c = next)
{
next = utf8_next_char(c);