Skip to content

Commit

Permalink
Correct a failing unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydumais committed Feb 6, 2022
1 parent 7b331f4 commit 1f2d46b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/smtpclientbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ int SMTPClientBase::getErrorMessage_r(int errorCode,
return -1;
}
if (errorMessageStr.length() > maxLength-1) {
strcpy(errorMessagePtr, errorMessageStr.c_str());
strncpy(errorMessagePtr, errorMessageStr.c_str(), maxLength-1);
errorMessagePtr[maxLength-1] = '\0';
return static_cast<int>(maxLength-1);
}
strcpy(errorMessagePtr, errorMessageStr.c_str());
Expand Down

0 comments on commit 1f2d46b

Please sign in to comment.