use signal safe ust_safe_snprintf()
[ust.git] / snprintf / prog.c
CommitLineData
bf0d695d
PMF
1#include <stdio.h>
2#include <string.h>
3
4int main()
5{
6 char buf[100];
7
8 char *expected;
9
10 expected = "header 9999, hello, 003";
11 ust_safe_snprintf(buf, 99, "header %d, %s, %03d", 9999, "hello", 3);
12 if(strcmp(buf, expected) != 0) {
13 printf("Error: expected \"%s\" and got \"%s\"\n", expected, buf);
14 return 1;
15 }
16
17 return 0;
18}
This page took 0.022444 seconds and 4 git commands to generate.