--- Keith Rollin <[EMAIL PROTECTED]> wrote:
> I think that the questionable parts of what you said would 
> be the parts John pointed out.  strlen can be used just 
> fine on the Palm (with development environment support, or 
> with one's own macros), 

All I said about strlen is "There is no strlen() function in the Palm
API".  I never said "you can't add strlen()."   But if someone has
added a strlen() function, there is no way to determine what it is or
how it works from the code he posts.

> there's little wrong with using "char*" instead of "Char*".

True, at the moment Char is a typedef for char (at least with CW). 
However, I didn't say there was anything wrong with it.  I said that
because of his use of strlen() and char, I wondered if what he posted
was actually from a Palm OS app, or was it something else.  It would
not have been the first time that this has happened on this forum.  In
this case, I was wrong.  But I don't think there was anything wrong
with saying "this is what I suspect" when giving an answer.  Obviously,
if the suspicion is wrong, the poster can either clarify, or he can
just ignore the advice that follows the incorrect assumption.

> Let's also take a look at the following that you posted:
> 
> >   // locate a space
> >   p = StrChr(sentence, ' ');
> >
> >   if (p)
> >     // found a space, so copy the word
> >     StrNCopy(word, sentence, (p - sentence));
> 
> This is questionable, not only because StrNCopy's definition has 
> changed in practically every release of the OS, but because even when
> using the standard definition of strncpy, you'll have a termination 
> problem.  You are guaranteeing that the result will not be properly 
> terminated with a NUL.

As you guessed, that was just something I typed in and I forgot to put
in the terminating 0 and I failed to say it was just
off-the-top-of-my-head code.  Didn't I already say it was late when I
wrote that?

BTW, the statement "That's the end of today's lesson on the C
programming language" was meant as sarcasm.  I guess I should have
inserted a bunch of smileys, but then the anti-smiley group would
complain about that!

- Joe "Though nobody questions Madonna (Ciccone), by popular demand,
here is a surname:" Malone


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to