---
name: "fmt_strn"
section: "3diet"
platform: "linux"
package: "libowfat-dev"
version: "0.28-2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/fmt_strn/3diet"
---

# fmt\_strn(3diet)

write an ASCII string

## NAME

fmt\_strn - write an ASCII string

## SYNTAX

**#include \<fmt.h\>**

size\_t **fmt\_strn**(char \**dest*,const char \**source*,\
                       size\_t *maxlen*);

## DESCRIPTION

fmt\_str copies at most *maxlen* leading nonzero bytes from *source* to *dest* and returns the number of bytes it copied.

fmt\_str does not append \\0.

If *dest* equals FMT\_LEN (i.e. is zero), fmt\_strn returns the number of bytes it would have written.

## SEE ALSO

[strncpy(3)](/strncpy/3.md)
