Mail Archives: djgpp/1998/08/04/13:30:28
From: | poletti AT my-dejanews DOT com
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Its me Please ...
|
Date: | Tue, 04 Aug 1998 17:00:38 GMT
|
Organization: | Deja News - The Leader in Internet Discussion
|
Lines: | 20
|
Message-ID: | <6q7enm$uo8$1@nnrp1.dejanews.com>
|
References: | <01bdbe08$aeac86c0$LocalHost AT default>
|
NNTP-Posting-Host: | 194.185.219.21
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
In article <01bdbe08$aeac86c0$LocalHost AT default>,
"Xee'Gh" <pekkaka AT dlc DOT fi> wrote:
> [...]
> char *wbuf, *wptr, c, l;
> [...]
> if (c > 191) /* This is the error point */ <77>
> [...]
Well, you should declare "int c" instead of "char c". Char is one byte,
signed, so it is allowed to go from -128 to 127... and your comparison will
always be 0 because 191 is surely greater than c. If you look at some
documentation, you will see that the return type of fgetc is int.
Bye,
Flavio.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
- Raw text -