bpe - binary patch editor
Port'naybl
kris at beep.UUCP
Tue Nov 6 05:42:06 AEST 1990
In article <668 at seer.UUCP>, clh at seer.UUCP (Chris Hatch) writes:
>In article <4902 at taux01.nsc.com> amos at taux01.nsc.com (Amos Shapir) writes:
>>The 'h' command doesn't work as distributed. To fix, precede each call to
>>'toupper' in hexsrch.c by an appropriate 'if(islower(a))' test.
>>(I wonder why people bother to post programs they never checked themselves
>>even once - there's no way this could have worked on any UNIX version I know)
On my System V.2 (beep), toupper (a) returns a unmodified if a is not
a lower-case character. This seems right and proper to me.
>Actually, by definition 'if (islower(a)) a=toupper(a);' should be the exact
>same thing as 'a=toupper(a);'. If that is not the case, then your compiler
>(or rather your library) is broken. This is in ANSI... Don't know about
>the Unix "standards."
One system (I will not name it) I worked on returned (a - 0x20) from
toupper (a) and the corresponding tolower (a) returned (a + 0x20) for ALL
valued of a. Took me a while to figure out that it WASN'T my program. I
finally wrote a quick-and-dirty utility that displayed how the <ctype.h>
functions handled the various byte values that could be fed to them. This
is how I discovered that toupper() and tolower() didn't act like I expected
them. Now I keep a copy of this utility on each system I use.
--
Port'naybl
key!beep!kris
woodowl!beep!kris
"Look what they've done to my program, look what they've done to my code;
They stuck it all on this floppy disk, and I think they got it wrong, ma..."
More information about the Alt.sources.d
mailing list