BOOTSTRAP (kutils) functions


LIBRARY ROUTINE

kstring_cleanup - remove white space from the ends of a string

LIBRARY CALL

char *kstring_cleanup(
   const char *istr,
   char       *ostr)

INPUT

OUTPUT

RETURN VALUE

The cleaned string in 'ostr' if it is not NULL, or a pointer to the resulting allocated string if 'ostr' is NULL. NULL is returned if istr is NULL, or an error occurs.

DESCRIPTION

This routine checks the beginning and end of the string for white space (using the function isspace()) and removes these characters. White space is defined to be a tab, space, carriage return, or line feed.

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

Allocates the space for the output string 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.