diff lwasm/pseudo.c @ 10:127e5b1e01c0

Removed use of asprintf() and added Makefile options for cross compiling; also a bugfix with sizeof{} in lwasm
author lost@l-w.ca
date Sat, 22 Jan 2011 10:37:53 -0700
parents 7317fbe024af
children 7e92484cfbc3
line wrap: on
line diff
--- a/lwasm/pseudo.c	Sat Jan 22 10:04:32 2011 -0700
+++ b/lwasm/pseudo.c	Sat Jan 22 10:37:53 2011 -0700
@@ -21,6 +21,7 @@
 
 #include <stdio.h>
 #include <ctype.h>
+#include <string.h>
 
 #include <lw_alloc.h>
 
@@ -1034,6 +1035,7 @@
 	char *fn, *p2;
 	char *p3;
 	int delim = 0;
+	int len;
 	
 	if (!**p)
 	{
@@ -1059,7 +1061,9 @@
 	if (delim && **p)
 		(*p)++;
 	
-	(void)(0 == asprintf(&p3, "include:%s", fn));
+	len = strlen(fn) + 8;
+	p3 = lw_alloc(len + 1);
+	sprintf(p3, "include:%s", fn);
 	input_open(as, p3);
 	lw_free(p3);