---
name: "strlcat"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/strlcpy"
---

# strlcat(3)

string return-hypothetical-non-truncated-length copy/catenate (with truncation)

Part of [strlcpy(3)](/strlcpy/3.md).

## NAME

strlcpy, strlcat - string return-hypothetical-non-truncated-length copy/catenate (with truncation)

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <string.h>
```

**size\_t strlcpy(**size\_t dsize;                **char** *dst***\[restrict** *dsize***\], const char \*restrict** *src***,**                **size\_t** *dsize***);** **size\_t strlcat(**size\_t dsize;                **char** *dst***\[restrict** *dsize***\], const char \*restrict** *src***,**                **size\_t** *dsize***);**

## DESCRIPTION

**strlcpy**() copies the string pointed to by *src*, into a string at the buffer pointed to by *dst*.

**strlcat**() catenates the string pointed to by *src*, after the string pointed to by *dst* (overwriting its terminating null byte).

For both functions, if the string doesn't fit in the buffer, it is truncated.

## RETURN VALUE

These functions return the total length of the string they tried to create, as if truncation didn't happen.

## STANDARDS

POSIX.1-2024.

## HISTORY

OpenBSD 2.4, POSIX.1-2024, glibc 2.38.

## BUGS

These functions are vulnerable to denial of service (DoS) attacks, since they read the entire source string.

[**strscpy**(9)](/strscpy/9.md) is a better function for copying with truncation, as it doesn't have that issue. It's not provided by libc, so users should write their own implementation.

## SEE ALSO

[**strlcpy**(3)](/strlcpy/3.md), [**strcpy**(3)](/strcpy/3.md), [**string**(3)](/string/3.md)
