summaryrefslogtreecommitdiffhomepage
path: root/ir/obstack
diff options
context:
space:
mode:
authorFIRM Projekt Account <firm@ipd.info.uni-karlsruhe.de>2010-05-04 14:39:44 +0200
committerFIRM Projekt Account <firm@ipd.info.uni-karlsruhe.de>2010-05-04 14:39:44 +0200
commit9427d14adb43b7c17865951c51a0ae4e39a51bb2 (patch)
treed280c923bc78e4de756f017598a05f9f4daa3f2c /ir/obstack
parent53c740e61018fc1172d2c290a486251efd4e906b (diff)
fix warnings and errors
[r27477]
Diffstat (limited to 'ir/obstack')
-rw-r--r--ir/obstack/obstack_printf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ir/obstack/obstack_printf.c b/ir/obstack/obstack_printf.c
index ab494bb..836ffa8 100644
--- a/ir/obstack/obstack_printf.c
+++ b/ir/obstack/obstack_printf.c
@@ -1,6 +1,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
+#include <assert.h>
#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);