diff --git a/libraries/AP_Filesystem/AP_Filesystem.cpp b/libraries/AP_Filesystem/AP_Filesystem.cpp index e62ec59208..564696bb97 100644 --- a/libraries/AP_Filesystem/AP_Filesystem.cpp +++ b/libraries/AP_Filesystem/AP_Filesystem.cpp @@ -290,6 +290,9 @@ bool AP_Filesystem::fgets(char *buf, uint8_t buflen, int fd) // run crc32 over file with given name, returns true if successful bool AP_Filesystem::crc32(const char *fname, uint32_t& checksum) { + // Ensure value is initialized + checksum = 0; + // Open file in readonly mode int fd = open(fname, O_RDONLY); if (fd == -1) {