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

# fmt\_fill(3diet)

append spaces to a string

## NAME

fmt\_fill - append spaces to a string

## SYNTAX

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

size\_t **fmt\_fill**(char \**dest*,\
       size\_t *srclen*, size\_t *padlen*,\
       size\_t *maxlen*);

## DESCRIPTION

fmt\_fill appends *padlen*-*srclen* spaces (if that number is positive) to *dest* (which holds *srclen* bytes).  It truncates the output only if the length would exceed *maxlen*.

It returns the number of bytes it wrote.

fmt\_fill does not append \\0.

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

## SEE ALSO

[fmt\_strn(3)](/fmt_strn/3.md), [fmt\_pad(3)](/fmt_pad/3.md)
