Skip to content

Commit

Permalink
Fix instances where STRDEF() was used instead of STR().
Browse files Browse the repository at this point in the history
In practice this didn't cause problems because the string buffer was still valid and strSize() was not being called.
  • Loading branch information
dwsteele committed Apr 21, 2022
1 parent 627921c commit a2eee15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/type/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ strCmpZ(const String *this, const char *compare)
FUNCTION_TEST_PARAM(STRINGZ, compare);
FUNCTION_TEST_END();

FUNCTION_TEST_RETURN(strCmp(this, compare == NULL ? NULL : STRDEF(compare)));
FUNCTION_TEST_RETURN(strCmp(this, compare == NULL ? NULL : STR(compare)));
}

/**********************************************************************************************************************************/
Expand Down
4 changes: 2 additions & 2 deletions test/src/common/harnessLog.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ hrnLogReplaceAdd(const char *expression, const char *expressionSub, const char *
HarnessLogReplace logReplace =
{
.expression = strNewZ(expression),
.regExp = regExpNew(STRDEF(expression)),
.regExp = regExpNew(STR(expression)),
.expressionSub = expressionSub == NULL ? NULL : strNewZ(expressionSub),
.regExpSub = expressionSub == NULL ? NULL : regExpNew(STRDEF(expressionSub)),
.regExpSub = expressionSub == NULL ? NULL : regExpNew(STR(expressionSub)),
.replacement = strNewZ(replacement),
.matchList = strLstNew(),
.version = version,
Expand Down

0 comments on commit a2eee15

Please sign in to comment.