BOOTSTRAP (kutils) functions


LIBRARY ROUTINE

kstring_cat - concatenate two strings

LIBRARY CALL

char *kstring_cat(
   const char *istr1,
   const char *istr2,
   char       *ostr)

INPUT

OUTPUT

RETURN VALUE

The concatenated string if 'ostr' is non-NULL, or the allocated string if 'ostr' is NULL. On NULL input strings or an error, a NULL is returned.

DESCRIPTION

This routine concatenates two strings together, into a third. If the output parameter is not NULL, the concatenated string is put into that string. Otherwise, the resulting string is allocated via a call to kmalloc(). In either case, the resulting string is returned.

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 non-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.