Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Concatenates a string to the end of another string.

Files

lib_str.h/lib_str.c

Prototype

Arguments

pstr_dest

Pointer to the string memory buffer to append string characters into.

pstr_cat

Pointer to the string to concatenate onto the destination string.

Returned Value

Pointer to concatenated destination string, if no errors;

Pointer to NULL, otherwise.

Required Configuration

None.

Notes / Warnings

Destination buffer size (pstr_dest) is not validated; buffer overruns must be prevented by caller. IEEE Std 1003.1, 2004 Edition, Section ‘strcat() : DESCRIPTION’ states that “the initial byte of [pstr_cat] overwrites the null byte at the end of [pstr_dest]” and a “terminating null byte” is appended “to the end of the string pointed to by [pstr_dest]”. Therefore, the destination buffer size must be large enough to accomodate the original destination string size plus the entire concatenated string size, but including only a single terminating NULL character.

String concatenation terminates if either string pointer points to or overlaps the NULL address.

Example Usage

  • No labels