---
name: "SDL_vsnprintf"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_vsnprintf"
---

# SDL\_vsnprintf(3)

This works exactly like vsnprintf() but doesn't require access to a C runtime.

## NAME

SDL\_vsnprintf - This works exactly like vsnprintf() but doesn't require access to a C runtime.

## HEADER FILE

Defined in SDL3/SDL\_stdinc.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**int SDL\_vsnprintf(char \*text, size\_t maxlen, const char \*fmt, va\_list ap);**

## DESCRIPTION

Functions identically to  **SDL\_snprintf** (), except it takes a **va\_list** instead of using **...** variable arguments.

## FUNCTION PARAMETERS

- *text*

  the buffer to write the string into. Must not be NULL.

- *maxlen*

  the maximum bytes to write, including the null-terminator.

- *fmt*

  a printf-style format string. Must not be NULL.

- *ap*

  a **va\_list** values to be used with the format string.

## RETURN VALUE

Returns the number of bytes that should be written, not counting the null-terminator char, or a negative value on error.

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.
