rockbox/firmware/test/snprintf/test.c
Daniel Stenberg 2955a2ead3 initial test code for the snprintf() (and family) function
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3449 a1c6a512-1295-4272-9138-f99709370657
2003-03-16 19:12:48 +00:00

17 lines
377 B
C

#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);
}