Skip to content

Commit b48f403

Browse files
committed
Fix CmdCallback_P strings comparison
According to documentation, strcasecmp_P takes first SRAM string then Flash string
1 parent 0c127fd commit b48f403

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/CmdCallback.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,12 @@ template <size_t STORESIZE>
172172
class CmdCallback_P : public _CmdCallback<STORESIZE, CmdParserString_P>
173173
{
174174
/**
175-
* @implement CmdCallbackObject with strcmp_P
175+
* @implement CmdCallbackObject with strcasecmp_P
176176
*/
177177
virtual bool equalStoreCmd(size_t idx, char *cmdStr)
178178
{
179179
if (this->checkStorePos(idx) &&
180-
strcasecmp_P(this->m_cmdList[idx], cmdStr) == 0) {
180+
strcasecmp_P(cmdStr, this->m_cmdList[idx]) == 0) {
181181
return true;
182182
}
183183

@@ -195,7 +195,7 @@ template <size_t STORESIZE>
195195
class CmdCallback : public _CmdCallback<STORESIZE, CmdParserString>
196196
{
197197
/**
198-
* @implement CmdCallbackObject with strcmp_P
198+
* @implement CmdCallbackObject with strcasecmp
199199
*/
200200
virtual bool equalStoreCmd(size_t idx, char *cmdStr)
201201
{

0 commit comments

Comments
 (0)