X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Eric Sosman Newsgroups: comp.lang.c,comp.os.msdos.djgpp Subject: Re: Fibonacci number Date: Mon, 23 Feb 2004 11:01:15 -0500 Organization: Sun Microsystems Lines: 16 Message-ID: <403A23CB.84B325E@sun.com> References: <4038E8CA DOT 6491815E AT virginia DOT edu> <4039DD96 DOT 3F36F3B7 AT yahoo DOT com> NNTP-Posting-Host: tardis.east.sun.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news1brm.Central.Sun.COM 1077552075 16544 129.148.168.113 (23 Feb 2004 16:01:15 GMT) X-Complaints-To: usenet AT news1brm DOT central DOT sun DOT com NNTP-Posting-Date: Mon, 23 Feb 2004 16:01:15 +0000 (UTC) X-Mailer: Mozilla 4.79C-CCK-MCD [en] (X11; U; SunOS 5.8 sun4u) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com CBFalconer wrote: > [...] > BTW the following shows up a glitch in DJGPP 2.03 system. Calling > the program with an argument of -1 returns the overflow condition, > because strtoul returns ULONG_MAX rather than 0. Cross-posted to > comp.os.msdos.djgpp for this. > [...] > n = strtoul(argv[1], NULL, 10); If you mean that strtoul("-1", NULL, 10) returns ULONG_MAX, then there's no bug: that's what it is supposed to do. See the Standard, section 7.20.1.4 paragraph 3, and note the text "optionally preceded by a plus or minus sign." -- Eric DOT Sosman AT sun DOT com