# PetscStrlcat
Concatenates a string onto a given string, up to a given length 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscStrlcat(char s[], const char t[], size_t n)
```
Not Collective


## Input Parameters

- ***s -*** pointer to string to be added to at end
- ***t -*** string to be added
- ***n -*** length of the original allocated string





## Note
Unlike the system call `strncat()`, the length passed in is the length of the
original allocated space, not the length of the left-over space. This is
similar to the BSD system call `strlcat()`.


## Fortran Note
Not for use in Fortran


## See Also
 `PetscStrcpy()`, `PetscStrncpy()`, `PetscStrcat()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/utils/str.c.html#PetscStrlcat">src/sys/utils/str.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/constrained/tutorials/maros.c.html">src/tao/constrained/tutorials/maros.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/utils/str.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
