| Updated: October 28, 2024 |
Concatenate one string on to the end of another
#include <string.h>
int straddstr( const char * str,
int len,
char ** pbuf,
size_t * pmaxbuf );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The straddstr() function adds str to the buffer pointed to by pbuf, respecting the maximum length indicated by pmaxbuf:
The function updates *pbuf to point to the end of the string (i.e., the terminating null character) and sets *pmaxbuf to be the number of bytes left in the string, including the terminating null character.
The value of len if it's nonzero; otherwise, the length of str (i.e., strlen(str)).
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | Yes |
| Signal handler | Yes |
| Thread | Yes |