diff --git a/Tools/AP_Bootloader/support.cpp b/Tools/AP_Bootloader/support.cpp index 993c89ceb3..82971ead2f 100644 --- a/Tools/AP_Bootloader/support.cpp +++ b/Tools/AP_Bootloader/support.cpp @@ -283,6 +283,9 @@ int strncmp(const char *s1, const char *s2, size_t n) s1++; s2++; } + if (n == 0) { + return 0; + } return (*s1 - *s2); }