]> mj.ucw.cz Git - umpf.git/blobdiff - lex.c
fix saving bodies
[umpf.git] / lex.c
diff --git a/lex.c b/lex.c
index 25e3a8a7bb7b02f15f2d3b2daff7f16f1521d828..9f0201319dfa47818beeef380a1786f45e8992a5 100644 (file)
--- a/lex.c
+++ b/lex.c
@@ -5,8 +5,7 @@
 #include <stdarg.h>
 
 #include "cond.tab.h"
-#include "brum.h"
-#define BUFSIZE 4096
+#include "umpf.h"
 #define KLEN 10 
 
 struct keys {
@@ -55,6 +54,17 @@ xmalloc(size_t size)
         return ret;
 }
 
+void*
+xrealloc(void* buf, size_t size)
+{
+       buf = realloc(buf, size);
+       
+       if (!buf)
+               die("Low memory");
+
+       return buf;
+}
+
 static void __attribute__ ((noreturn)) 
 parse_err(char* msg, ...)
 {
@@ -69,7 +79,7 @@ parse_err(char* msg, ...)
 }
 
 char*
-xstrdup(char* s)
+xstrdup(const char* s)
 {
         void* ret;