IM:
> Is StrNCopy the same as normal strncpy or not, as in, would it add a
> trailing \0 to the end of string if it exceeds maxlen or not?

DE:
> The latest docs I have say:
> Terminates dst string at index n-1 if the source string length was n-1
> or less.

IM:
> That, however, does *not* answer my question in any way... :-( It does
rise 
> another one:- what's an 'index', is it the offset from the start??? Am I 
> being picky again???

I guess I still don't understand your original question. Here's the header:

Char* StrNCopy (Char* dst, const Char* src, Int16 n)

The docs say this function copies up to n (the last arg) bytes from src (the
second arg) to dst (the first arg), and that it terminates dst at index n-1
(meaning it writes a zero byte at dst[n-1]) if the length of src is n-1 or
less (StrLen(src) <= n-1).

This probably answers your second question: the index is the usual
zero-based kind.

The docs don't explicitly say that StrNCopy doesn't null terminate dst when
StrLen(src) > n-1, but they certainly imply that. (They could have used
"iff" instead of "if" if they wanted to be more technically correct, but
maybe that's too geeky?)

Your original question used different terminology. I assumed that your were
asking whether StrNCopy will write a null terminator to the destination
string if the length of the source string exceeds the number of characters
to be copied (the last argument). Maybe you should restate the question. :)
--
Danny

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

Reply via email to