From c44a8309f98acad46657d3f5180558ff4b75a678 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 28 Jun 2018 11:04:59 +1000 Subject: [PATCH] AP_Bootloader: fixed strncmp bug --- Tools/AP_Bootloader/support.cpp | 3 +++ 1 file changed, 3 insertions(+) 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); }