summaryrefslogtreecommitdiff
path: root/firmware/test/snprintf/test.c
blob: 8923c9c9f5bb82412d5b3ae7f1193a9c1c227020 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

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