[Coco] help with C problem

Bob Devries bdevries at gil.com.au
Mon Jan 2 06:54:15 EST 2006


To all you C gurus: I have a problem with compiling the following code:

char *
strhcpy(s1, s2)
char *s1;
char *s2;
{
         while ((int)*s2 < 128) { /* line 8*/
               *s1++ = *s2++;
               }
         *s1++ = *s2++ & 0x7F;
         *s1 = '\0';
         return (s1);
}

The compiler always gives a warning  in line 8:  [Warning] comparison is 
always true due to limited range of data type

Can someone PLEASE tell me what I'm doing wrong?
Yes, you're right, I'm trying to write a PC version of the OS9 library 
function strhcpy().

--
Regards, Bob Devries, Dalby, Queensland, Australia

Isaiah 50:4 The sovereign Lord has given me
the capacity to be his spokesman,
so that I know how to help the weary.

website: http://www.home.gil.com.au/~bdevasl
my blog: http://bdevries.invigorated.org/




More information about the Coco mailing list