X-Authentication-Warning: acp3bf.physik.rwth-aachen.de: broeker owned process doing -bs Date: Mon, 14 Jun 1999 16:56:36 +0200 (MET DST) From: Hans-Bernhard Broeker X-Sender: broeker AT acp3bf To: djgpp-workers AT delorie DOT com Subject: Re: strtol In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 14 Jun 1999, Eli Zaretskii wrote: > > On Sun, 13 Jun 1999, Morten Welinder wrote: > > > It's subtle. If s is a "char *" or "signed char *" and c is an int, > > > then after "c = *s;", c is -27. isdigit is only defined in the > > > range -1 to 255. (EOF is -1.) > Does the following seem okay? It works for me. It may work, but it's a bit unclear. The cast to (unsigned char) would be cleaner, I think. Or, for that matter, defining c as an unsigned char variable straight away. The rule is simple: a char that is to be passed to a functions must either already *be* a unsigned char, or be casted into one. Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.