BOOTSTRAP (kutils) functions


LIBRARY ROUTINE

kstring_3cat - concatenate three strings together

LIBRARY CALL

char *kstring_3cat(
   const char *istr1,
   const char *istr2,
   const char *istr3,
   char       *ostr)

INPUT

OUTPUT

RETURN VALUE

The concatenated string in 'ostr' if it is non-NULL, or an allocated string if 'ostr' is NULL. This routine returns NULL if 'istr1', 'istr2', and 'istr3' are NULL, or an error occurs.

DESCRIPTION

This routine concatenates three strings together, into a new string. If the output parameter is not NULL, the concatenated string is put into that string. Otherwise, the resulting string is allocated via kmalloc(). In either case, the resulting NULL-terminated string is returned. The concatenation is as follows; the second string is added to the end of the first, and the third string is added to the end of the first two.

Note that if 'ostr' is non-NULL, the calling routine must ensure that 'ostr' points to a memory buffer large enough to hold the concatenated 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

This routine uses kmalloc() to create a string that holds the result if 'ostr' is NULL.

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.