From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: bug report? Date: Wed, 20 Aug 1997 18:20:01 +0000 Organization: Two pounds of chaos and a pinch of salt Lines: 33 Message-ID: <33FB3551.246D@cs.com> References: <33FAB80D DOT 6186 AT nv DOT aif DOT or DOT jp> Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp215.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk daisuke wrote: > > I use gcc for MS-DOS ported by you, and I am facing problem. I found > that atoi function and fgets function working starangely. I used atoi, > but it returns incorrect value. The argument was a character > representing one digit integer, but it returns four digit integer. For > fgets function, file pointer increment is incorrect. It read a string > containing 70 character, but increment was only 2 bytes. Those > functions sometimes work properly, sometimes don't. > > Is there debugged version already, or patch? Please give further details on your attempts to use these functions, such as sample code and data. As a 32-bit compiler, DJGPP has features which may confuse you if you are used to 16-bit compilers like Borland and MSVC. For example, integers are four bytes instead of two. I don't know if this could be causing your problem; we need more specific details. Please post the smallest working program which displays the problems you are experiencing, along with the data you are trying to read. Also, make sure you're compiling your program with all the warning options turned on, such as '-Wall'. These will often catch less obvious mistakes. hth -- --------------------------------------------------------------------- | John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com | | Descent 2: The Infinite Abyss - The greatest Internet game of all | | time just got better! This time, you're going all the way down...| ---------------------------------------------------------------------