Fix and document yangfuzz for libyang2.
diff --git a/tests/fuzz/yangfuzz.c b/tests/fuzz/yangfuzz.c
index 52940b3..06d6076 100644
--- a/tests/fuzz/yangfuzz.c
+++ b/tests/fuzz/yangfuzz.c
@@ -4,23 +4,24 @@
#include "libyang.h"
int main(int argc, char **argv) {
-
- if (argc != 2) {
- fprintf(stderr, "invalid usage\n");
- exit(EXIT_FAILURE);
- }
+ if (argc != 2) {
+ fprintf(stderr, "invalid usage\n");
+ exit(EXIT_FAILURE);
+ }
- struct ly_ctx *ctx = NULL;
+ struct ly_ctx *ctx = NULL;
LY_ERR err;
- while (__AFL_LOOP(100)) {
+ while (__AFL_LOOP(100)) {
err = ly_ctx_new(NULL, 0, &ctx);
if (err != LY_SUCCESS) {
fprintf(stderr, "Failed to create context\n");
exit(EXIT_FAILURE);
}
- lys_parse_path(ctx, argv[1], LYS_IN_YANG);
- ly_ctx_destroy(ctx, NULL);
- }
+ lys_parse_path(ctx, argv[1], LYS_IN_YANG);
+ ly_ctx_destroy(ctx, NULL);
+ }
+
+ return 0;
}