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) { |
Juraj Vijtiuk | 04f7127 | 2019-08-07 06:49:00 -0400 | [diff] [blame^] | 7 | if (argc != 2) { |
| 8 | fprintf(stderr, "invalid usage\n"); |
| 9 | exit(EXIT_FAILURE); |
| 10 | } |
Juraj Vijtiuk | f3939c9 | 2019-05-14 13:07:38 +0200 | [diff] [blame] | 11 | |
| 12 | |
Juraj Vijtiuk | 04f7127 | 2019-08-07 06:49:00 -0400 | [diff] [blame^] | 13 | struct ly_ctx *ctx = NULL; |
Juraj Vijtiuk | f3939c9 | 2019-05-14 13:07:38 +0200 | [diff] [blame] | 14 | LY_ERR err; |
Juraj Vijtiuk | 04f7127 | 2019-08-07 06:49:00 -0400 | [diff] [blame^] | 15 | while (__AFL_LOOP(100)) { |
Juraj Vijtiuk | f3939c9 | 2019-05-14 13:07:38 +0200 | [diff] [blame] | 16 | err = ly_ctx_new(NULL, 0, &ctx); |
| 17 | if (err != LY_SUCCESS) { |
| 18 | fprintf(stderr, "Failed to create context\n"); |
| 19 | exit(EXIT_FAILURE); |
| 20 | } |
| 21 | |
Juraj Vijtiuk | 04f7127 | 2019-08-07 06:49:00 -0400 | [diff] [blame^] | 22 | lys_parse_path(ctx, argv[1], LYS_IN_YANG); |
| 23 | ly_ctx_destroy(ctx, NULL); |
| 24 | } |
| 25 | |
| 26 | return 0; |
Juraj Vijtiuk | f3939c9 | 2019-05-14 13:07:38 +0200 | [diff] [blame] | 27 | } |