diff options
author | Robert Swiecki <robert@swiecki.net> | 2018-01-12 02:23:42 +0100 |
---|---|---|
committer | Robert Swiecki <robert@swiecki.net> | 2018-01-12 02:23:42 +0100 |
commit | fff99812642a7eb30f127c5f84110e7a2b5e6bd3 (patch) | |
tree | dc44bcf6cc126ac1d98bac2c1a4337a31eadc821 /fuzz.c | |
parent | 28cc4cb142b49a429ebda69cbe55f9a34ff30ef8 (diff) | |
download | honggfuzz-fff99812642a7eb30f127c5f84110e7a2b5e6bd3.tar.gz |
fuzz: correct test for files_exists
Diffstat (limited to 'fuzz.c')
-rw-r--r-- | fuzz.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -238,15 +238,14 @@ static bool fuzz_writeCovFile(const char* dir, const uint8_t* data, size_t len) snprintf(fname, sizeof(fname), "%s/%016" PRIx64 "%016" PRIx64 ".%08" PRIx32 ".honggfuzz.cov", dir, crc64f, crc64r, (uint32_t)len); - if (files_exists(fname) == 0) { + if (files_exists(fname)) { LOG_D("File '%s' already exists in the output corpus directory '%s'", fname, dir); return true; } LOG_D("Adding file '%s' to the corpus directory '%s'", fname, dir); - if (files_writeBufToFile(fname, data, len, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC | O_CLOEXEC) == - false) { + if (!files_writeBufToFile(fname, data, len, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC)) { LOG_W("Couldn't write buffer to file '%s'", fname); return false; } |