[elinks-users] Re: ELinks 0.9.1 on Mac OS X 10.3.2

Jonas Fonseca fonseca at diku.dk
Fri Mar 19 00:43:44 PST 2004


Jonas Fonseca <fonseca at diku.dk> wrote Fri, Mar 19, 2004:
> I don't know if you would care to compile with debug too and see
> if the same thing happens for you?

I commited the attached patch to cvs so maybe you could just test that
one.

-- 
Jonas Fonseca
-------------- next part --------------
Index: document/html/frames.c
===================================================================
RCS file: /home/cvs/elinks/elinks/src/document/html/frames.c,v
retrieving revision 1.49
diff -u -d -u -r1.49 frames.c
--- document/html/frames.c	22 Jan 2004 17:46:57 -0000	1.49
+++ document/html/frames.c	19 Mar 2004 08:39:40 -0000
@@ -354,10 +354,16 @@
 
 		while (isspace(*str)) str++;
 
-		/* Extract number. */
-		errno = 0;
-		number = strtoul(str, (char **)&str, 10);
-		if (errno) return 0;
+		/* strtoul() will set errno on some platforms if first char is
+		 * not a digit. */
+		if (isdigit(*str)) {
+			/* Extract number. */
+			errno = 0;
+			number = strtoul(str, (char **)&str, 10);
+			if (errno) return 0;
+		} else {
+			number = 0;
+		}
 
 		/* @number is an ulong, but @val is int,
 		 * so check if @number is in a reasonable


More information about the elinks-users mailing list