---
name: "firestring_snprintf"
section: "3"
platform: "linux"
package: "libfirestring-dev"
version: "0.9.12-8"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/firestring_snprintf"
---

# firestring\_snprintf(3)

snprintf(3) provided as a replacement so programs can maintain ANSI C compliance

## NAME

firestring\_snprintf - [**snprintf**(3)](/snprintf/3.md) provided as a replacement so programs can maintain ANSI C compliance

## SYNOPSIS

**#include \<firestring.h\>**\
 **-lfirestring**

**long firestring\_snprintf(char \*** *out***, const size\_t** *size***, const char \* const** *format***,** *...***)**

## DESCRIPTION

firestring\_snprintf() writes a maximum of *size* bytes to *out* based on the formatting rules specified in *format* and the further arguments provided.

As [**snprintf**(3)](/snprintf/3.md) is not a ANSI C function, firestring\_snprintf() is provided as a replacement for programs wishing to maintain ANSI C compliance.  It acts much like [**snprintf**(3)](/snprintf/3.md), except that it only uses single-letter format tags, and only supports a subset of the common formats.

Formats supported:\
 %s - char \*\
 %d - int\
 %l - long\
 %u - unsigned int\
 %y - unsigned long\
 %g - signed long long\
 %o - unsigned long long\
 %f - double\
 %t - time\_t (printed in ISO format)\
 %e - struct firestring\_estr\_t \*

The %s type handles NULL values by displaying the string "(null)".  All numeric types support zero padding through the standard %02d format.

## RETURN VALUE

Returns the number of bytes written to *out* not including the trailing nil.

## AUTHOR

Ian Gulliver \<ian@penguinhosting.net\>

## SEE ALSO

[**libfirestring**(3)](/libfirestring/3.md)
