From 7364b6cf8088e44ed8161099cecc9c1c6882d9bb Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Mon, 6 Aug 2018 20:57:17 +0200 Subject: [PATCH] Do not compare signed value with unsigned, add parentheses. --- Firmware/cardreader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/cardreader.cpp b/Firmware/cardreader.cpp index bea3fdec..44db2c19 100644 --- a/Firmware/cardreader.cpp +++ b/Firmware/cardreader.cpp @@ -325,7 +325,7 @@ void CardReader::diveSubfolder (const char *fileName, SdFile& dir) const size_t maxLen = 12; char subdirname[maxLen+1]; subdirname[maxLen] = 0; - const size_t len = (dirname_end-dirname_start)>maxLen ? maxLen : dirname_end-dirname_start; + const size_t len = ((static_cast(dirname_end-dirname_start))>maxLen) ? maxLen : (dirname_end-dirname_start); strncpy(subdirname, dirname_start, len); SERIAL_ECHOLN(subdirname); if (!dir.open(curDir, subdirname, O_READ))