scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 7dd517166fa92d4fd8d57599b50d8b9394eea693
parent 47e042802dd3438d7a009a30aaf73bbb7bc7ffed
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 26 Jan 2016 15:26:31 +0100

[cc1] Do not include the \0 in initialized strings

The target string is initialized to \0, so we don't have to
include explicitily the \0, because in this cause it was
incrementing the size of the target in 1.

Diffstat:
cc1/init.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cc1/init.c b/cc1/init.c @@ -120,7 +120,7 @@ initialize(Type *tp) errorp("array of inappropriate type initialized from string constant"); goto return_zero; } - len = sym->type->n.elem; + len = sym->type->n.elem-1; if (!tp->defined) { tp->defined = 1; tp->n.elem = len+1;