Skip to content

Fix return statement in NameList::get() method#125

Open
Renan0eng wants to merge 1 commit into
samdenty:masterfrom
Renan0eng:master
Open

Fix return statement in NameList::get() method#125
Renan0eng wants to merge 1 commit into
samdenty:masterfrom
Renan0eng:master

Conversation

@Renan0eng

Copy link
Copy Markdown

I was trying to compile the project on an ESP8266 and encountered this error:

the fix was simple, just moving the return statement of the function "NameList::get(int num)" from line 60 to 61 in the file "NameList.cpp", here's the code:
[code]
I would like others not to have the same error, even though it's a simple mistake, beginners might get discouraged and waste hours. Thank you in advance.

the fix was simple, just moving the return statement of the function "NameList::get(int num)" from line 60 to 61 in the file "NameList.cpp", here's the code:

String NameList::get(int num) {
  String returnStr;
  if (num >= 0) {
    for (int h = 0; h < nameLength; h++) {
      if (names[num][h] != 0x00) returnStr += (char)names[num][h];
    }
    returnStr.trim();
  }
  return returnStr;
}

I would like others not to have the same error, even though it's a simple mistake, beginners might get discouraged and waste hours. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant