]> git.proxmox.com Git - libgit2.git/blobdiff - fuzzers/standalone_driver.c
New upstream version 1.1.0+dfsg.1
[libgit2.git] / fuzzers / standalone_driver.c
index 000bfbfa427b389b063c8e0cbe22f22a4a249f61..90e7013339c63df777b96099e224e4d729a4fcae 100644 (file)
@@ -5,14 +5,10 @@
  * a Linking Exception. For full terms see the included COPYING file.
  */
 
-#include <assert.h>
-#include <dirent.h>
 #include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
 
 #include "git2.h"
-#include "fileops.h"
+#include "futils.h"
 #include "path.h"
 
 extern int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size);
@@ -24,7 +20,7 @@ static int run_one_file(const char *filename)
        int error = 0;
 
        if (git_futils_readbuffer(&buf, filename) < 0) {
-               fprintf(stderr, "Failed to read %s: %m\n", filename);
+               fprintf(stderr, "Failed to read %s: %s\n", filename, git_error_last()->message);
                error = -1;
                goto exit;
        }
@@ -57,7 +53,8 @@ int main(int argc, char **argv)
        LLVMFuzzerInitialize(&argc, &argv);
 
        if (git_path_dirload(&corpus_files, argv[1], 0, 0x0) < 0) {
-               fprintf(stderr, "Failed to scan corpus directory: %m\n");
+               fprintf(stderr, "Failed to scan corpus directory '%s': %s\n",
+                       argv[1], git_error_last()->message);
                error = -1;
                goto exit;
        }