Embedded TCP/IP stack
4.7.0
|
fnet_size_t fnet_snprintf | ( | fnet_char_t * | str, |
fnet_size_t | size, | ||
const fnet_char_t * | format, | ||
... | |||
) |
Print formatted text to the buffer. The length of the buffer is given, that prevents the buffer overflows.
str | Pointer to buffer where the resulting string is stored. |
size | Maximum number of characters to produce. The trailing null character is counted towards this limit |
format | Format string. |
This function is just like fnet_sprintf(), except that the length of the buffer is given. This prevents buffer overflows.
The format
string contains the text to be written to the str
buffer. The optional arguments following format
are items (integers, characters or strings) that are to be converted to character strings and inserted into the output of format
at specified placeholders. The number of arguments following the format
parameters should at least be as much as the number of format placeholders.
The syntax for a format placeholder is "%[Flags][Width][Length]Type".
-
: Left justify.+
: Right justify.0
: Pad with leading zeros.h
: Short integer.l
: Long integer.d
, i
: Integer.u
: Unsigned.x
, X
: Hexadecimal.o
: Octal.b
: Binary.p
: Pointer.c
: Single char.s
: Char string.n
: Nothing.