--On 27 July 2001 11:49 -0700 Danny Epstein <[EMAIL PROTECTED]>
wrote:
> 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???
DE:
> I guess I still don't understand your original question.
<snip>
> 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. :) --
My question is:-
{
Char dst[200];
Char src[500];
MemSet(src, 499, 32);
src[500] = \0;
StrNCopy(str, src, 200);
FrmCustomAlert(ID_ALERT, "It ", src[500] == \0 ? "is": "is not", "
terminated");
}
What would the alert say?
IM :-|
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/