aboutsummaryrefslogtreecommitdiff
path: root/init.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-04-14 14:57:01 -0700
committerMichael Forney <mforney@mforney.org>2021-05-02 11:56:52 -0700
commitab3187e9d02a9e4c3395c28858ac179d1fc5787b (patch)
tree9365a19767b35e00bfe2e9cfcf5e82fd113f4895 /init.c
parent197fc75ab9850402b47d79da2e6cde47c8deb7d4 (diff)
expr: Include NUL-terminator in string expression data
This will facilitate the support of wide-string literals. Based on patch from Nihal Jere.
Diffstat (limited to 'init.c')
-rw-r--r--init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/init.c b/init.c
index 0e890c0..aadf951 100644
--- a/init.c
+++ b/init.c
@@ -251,7 +251,7 @@ parseinit(struct scope *s, struct type *t)
break;
expr = expr->base;
if (t->incomplete)
- updatearray(t, expr->string.size);
+ updatearray(t, expr->string.size - 1);
goto add;
case TYPESTRUCT:
case TYPEUNION: