rockbox/firmware/test/snprintf/test.c

18 lines
377 B
C
Raw Normal View History

#include <stdio.h>
#include "sprintf.h"
int main(int argc, char **argv)
{
char buffer[256];
snprintf(buffer, 5, "123456789");
printf("%s\n", buffer);
snprintf(buffer, 6, "123456789");
printf("%s\n", buffer);
snprintf(buffer, 7, "123456789");
printf("%s\n", buffer);
snprintf(buffer, 7, "123%s", "mooooooooooo");
printf("%s\n", buffer);
}