From: FIRM Projekt Account Date: Tue, 4 May 2010 12:39:44 +0000 (+0000) Subject: fix warnings and errors X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=9427d14adb43b7c17865951c51a0ae4e39a51bb2;p=libfirm fix warnings and errors [r27477] --- diff --git a/ir/obstack/obstack_printf.c b/ir/obstack/obstack_printf.c index ab494bb99..836ffa8d0 100644 --- a/ir/obstack/obstack_printf.c +++ b/ir/obstack/obstack_printf.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "obstack.h" #ifdef _WIN32 @@ -11,7 +12,7 @@ int obstack_printf(struct obstack *obst, const char *fmt, ...) { char buf[128]; char *buffer = buf; - size_t size = lengthof(buf); + size_t size = sizeof(buf); va_list ap; int len; @@ -37,7 +38,7 @@ int obstack_printf(struct obstack *obst, const char *fmt, ...) } else { break; } - buffer = malloc(buffer, size); + buffer = malloc(size); } obstack_grow(obst, buffer, len);