trace_matches: fix return value bug
[ust.git] / tests / 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
69f1f652
PMF
10 expected = "header 9999, hello, 005, ' 9'";
11 ust_safe_snprintf(buf, 99, "header %d, %s, %03d, '%3$*d'", 9999, "hello", 5, 9);
bf0d695d
PMF
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.02275 seconds and 4 git commands to generate.