From: Till Riedel Date: Thu, 26 Jun 2003 11:23:45 +0000 (+0000) Subject: We now conform to iso-c99 X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=486c118ff659beeafd759c6331f95c2e269a455a;p=libfirm We now conform to iso-c99 fixed array access out of bounds [r1406] --- diff --git a/ir/tv/strcalc.c b/ir/tv/strcalc.c index b016fb3aa..20d0cbd2f 100644 --- a/ir/tv/strcalc.c +++ b/ir/tv/strcalc.c @@ -1304,7 +1304,7 @@ const char *sc_print(const void *value, unsigned bits, enum base_t base) char *pos; const char *digits = small_digits; - pos = output_buffer + BIT_PATTERN_SIZE; + pos = output_buffer + BIT_PATTERN_SIZE ; *pos = '\0'; /* special case */ @@ -1436,8 +1436,8 @@ void init_strcalc(int precision_in_bytes) CALC_BUFFER_SIZE = (4 * precision_in_bytes); MAX_VALUE_SIZE = (2 * precision_in_bytes); - calc_buffer = malloc(CALC_BUFFER_SIZE * sizeof(char)); - output_buffer = malloc(BIT_PATTERN_SIZE * sizeof(char)); + calc_buffer = malloc(CALC_BUFFER_SIZE+1 * sizeof(char)); + output_buffer = malloc(BIT_PATTERN_SIZE+1 * sizeof(char)); if (calc_buffer == NULL || output_buffer == NULL) { diff --git a/ir/tv/tv.c b/ir/tv/tv.c index 3223de8e3..748f2f8a6 100644 --- a/ir/tv/tv.c +++ b/ir/tv/tv.c @@ -41,6 +41,7 @@ #include /* assertions */ #include /* atoi() */ #include /* nice things for strings */ +#include /* nice things for strings */ #include #include "tv_t.h"