2019-05-07 02:18:18 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
2019-11-11 23:45:21 +00:00
|
|
|
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2019-05-07 02:18:18 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2021-10-14 01:12:07 +00:00
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
2019-05-07 02:18:18 +00:00
|
|
|
{
|
|
|
|
char *buf;
|
|
|
|
|
|
|
|
printf("Hello world!\n");
|
|
|
|
|
|
|
|
buf = malloc(1024);
|
|
|
|
if (!buf) {
|
|
|
|
printf("malloc buf failed\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
printf("buf ptr: %p\n", buf);
|
|
|
|
|
2019-11-20 13:16:36 +00:00
|
|
|
snprintf(buf, 1024, "%s", "1234\n");
|
2019-05-07 02:18:18 +00:00
|
|
|
printf("buf: %s", buf);
|
|
|
|
|
|
|
|
free(buf);
|
|
|
|
return 0;
|
|
|
|
}
|