changeset 149:729a9c70934e

Fixed crash and bogus warning with os9 module target
author lost@l-w.ca
date Fri, 26 Aug 2011 23:36:00 -0600
parents 08fb11004df9
children 244f1227f2b5
files lwlink/link.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lwlink/link.c	Fri Aug 26 23:26:00 2011 -0600
+++ b/lwlink/link.c	Fri Aug 26 23:36:00 2011 -0600
@@ -500,7 +500,8 @@
 	if (found != 1)
 	{
 		rval = NULL;
-		fprintf(stderr, "Warning: multiple instances of section %s found; ignoring all of them which is probably not what you want\n", name);
+		if (found > 1)
+			fprintf(stderr, "Warning: multiple instances of section %s found; ignoring all of them which is probably not what you want\n", name);
 	}
 	return rval;
 }
@@ -537,7 +538,7 @@
 		linkscript.name = (char *)(s -> code);
 	}
 	
-	for (sym = s -> localsyms; s; sym = sym -> next)
+	for (sym = s -> localsyms; sym; sym = sym -> next)
 	{
 		char *sm = (char *)(sym -> sym);
 		if (!strcasecmp(sm, "type"))