| 1 |
#include <string.h> |
| 2 |
#include <unistd.h> |
| 3 |
#include <stdlib.h> |
| 4 |
#include <stdio.h> |
| 5 |
|
| 6 |
#include "nstring.h" |
| 7 |
|
| 8 |
#define true (1) |
| 9 |
#define false (0) |
| 10 |
|
| 11 |
int |
| 12 |
main(int argc, char **argv) { |
| 13 |
|
| 14 |
char snprintfNResult[80]; |
| 15 |
const char * asprintfNResult; |
| 16 |
|
| 17 |
printf("Hello world.\n"); |
| 18 |
|
| 19 |
snprintfN(snprintfNResult, 19, "snprintfN test truncated"); |
| 20 |
|
| 21 |
printf("snprintfN result='%s'\n", snprintfNResult); |
| 22 |
|
| 23 |
asprintfN(&asprintfNResult, "asprintf'ed string %d %u %s", |
| 24 |
5, 89, "substring"); |
| 25 |
|
| 26 |
printf("asprintfN result='%s'\n", asprintfNResult); |
| 27 |
|
| 28 |
strfree(asprintfNResult); |
| 29 |
return 0; |
| 30 |
} |