Juraj Vijtiuk | f3939c9 | 2019-05-14 13:07:38 +0200 | [diff] [blame] | 1 | #include <stdio.h> |
| 2 | #include <stdlib.h> |
| 3 | |
| 4 | #include "libyang.h" |
| 5 | |
| 6 | int main(int argc, char **argv) { |
| 7 | |
| 8 | if (argc != 2) { |
| 9 | fprintf(stderr, "invalid usage\n"); |
| 10 | exit(EXIT_FAILURE); |
| 11 | } |
| 12 | |
| 13 | |
| 14 | struct ly_ctx *ctx = NULL; |
| 15 | LY_ERR err; |
| 16 | while (__AFL_LOOP(100)) { |
| 17 | err = ly_ctx_new(NULL, 0, &ctx); |
| 18 | if (err != LY_SUCCESS) { |
| 19 | fprintf(stderr, "Failed to create context\n"); |
| 20 | exit(EXIT_FAILURE); |
| 21 | } |
| 22 | |
| 23 | lys_parse_path(ctx, argv[1], LYS_IN_YANG); |
| 24 | ly_ctx_destroy(ctx, NULL); |
| 25 | } |
| 26 | } |