Reformat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
diff --git a/fuzzers/config_file_fuzzer.c b/fuzzers/config_file_fuzzer.c
index eafcd10..8698120 100644
--- a/fuzzers/config_file_fuzzer.c
+++ b/fuzzers/config_file_fuzzer.c
@@ -5,37 +5,38 @@
#include <unistd.h>
#include <limits.h>
-int foreach_cb(const git_config_entry *entry, void *payload) {
- return 0;
+int foreach_cb(const git_config_entry *entry, void *payload)
+{
+ return 0;
}
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
- static int fd = -1;
- static char path[] = "/tmp/git.XXXXXX";
- if (fd < 0) {
- git_libgit2_init();
- fd = mkstemp(path);
- if (fd < 0) {
- abort();
- }
- }
- if (ftruncate(fd, 0) !=0 ) {
- abort();
- }
- if (lseek(fd, 0, SEEK_SET) != 0) {
- abort();
- }
- if (write(fd, data, size) != size) {
- abort();
- }
+ static int fd = -1;
+ static char path[] = "/tmp/git.XXXXXX";
+ if (fd < 0) {
+ git_libgit2_init();
+ fd = mkstemp(path);
+ if (fd < 0) {
+ abort();
+ }
+ }
+ if (ftruncate(fd, 0) !=0 ) {
+ abort();
+ }
+ if (lseek(fd, 0, SEEK_SET) != 0) {
+ abort();
+ }
+ if (write(fd, data, size) != size) {
+ abort();
+ }
- git_config *cfg;
- int err = git_config_open_ondisk(&cfg, path);
- if (err == 0) {
- git_config_foreach(cfg, foreach_cb, NULL);
- git_config_free(cfg);
- }
+ git_config *cfg;
+ int err = git_config_open_ondisk(&cfg, path);
+ if (err == 0) {
+ git_config_foreach(cfg, foreach_cb, NULL);
+ git_config_free(cfg);
+ }
- return 0;
+ return 0;
}