BOOTSTRAP (kutils) functions
LIBRARY ROUTINE
kstrncpy - copy the first n characters in a string
LIBRARY CALL
char *kstrncpy(
char *ostr,
const char *istr,
size_t num)
INPUT
- istr - The string to copy from.
- num - The number of characters to copy.
OUTPUT
- ostr - The string to copy into.
RETURN VALUE
A pointer to 'ostr' after up to num 'istr' is copied
to 'ostr'. If 'ostr' is NULL, then NULL is returned.
If 'istr' is NULL or num is less than or equal to
zero, then 'ostr' is returned unchanged.
DESCRIPTION
This function copies a specified number of characters
from one string to another. This function is similar to
system call strncpy(). kstrncopy() copies up to num
characters in the input string to the output string.
Note that the calling routine must ensure that 'ostr'
points to a memory buffer large enough to hold the
copied string and terminating null character.
If the buffer is not large enough, memory will be
overwritten resulting in unpredicable program failure.
ADDITIONAL INFORMATION
none
EXAMPLES
none
SIDE EFFECTS
none
RESTRICTIONS
none
MODIFICATION
none
FILES
$BOOTSTRAP/objects/library/kutils/src/strings.c
SEE ALSO
kutils(3)
COPYRIGHT
Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.