Re: A89: installing C Event Hooks + misc other...


[Prev][Next][Index][Thread]

Re: A89: installing C Event Hooks + misc other...




While at school today, I realized that that bug that i referred to could
easily be solved with this code.

inline unsigned int isLike(const char* const s1, const char* const s2)
{
 unsigned int x=0;
 while(s2[x]!=0 && s1[x]==s2[x])
  x++;

 return s2[x]==0?x:0;
}

This is the best I can think of...
It gets rid of that annoying warning and i can declare everything const like
i wanted to do in the original...

----- Original Message -----
From: "Greg" <newstome2001@yahoo.com>
To: <assembly-89@lists.ticalc.org>
Sent: Tuesday, February 13, 2001 7:34 AM
Subject: Re: A89: installing C Event Hooks + misc other...


>
>
> > while(s2[x]!=0 && s1[x]==s2[x])
> >   x++;
>
> darn, i am looking at your code an see a bug,
> the original function called strlen because either x had to == strlen(s2)
> or else the function must return NULL
>
> so either way, I think that one would need to loop through s2 up to two
> times...
>
> Greg
> _________________________________
> All parts should go together without forcing. You must remember that the
> parts you are reassembling were disassembled by you. Therefore, if you
can't
> get them together again, there must be a reason. By all means, do not use
a
> hammer.
> -- IBM maintenance manual, 1925
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




References: