Skip to content

Commit 1a0d946

Browse files
Update checkfunctions.cpp
1 parent c3df665 commit 1a0d946

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/checkfunctions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void CheckFunctions::invalidFunctionUsage()
153153
// Is non-null terminated local variable of type char (e.g. char buf[] = {'x'};) ?
154154
if (variable && variable->isLocal()
155155
&& valueType && (valueType->type == ValueType::Type::CHAR || valueType->type == ValueType::Type::WCHAR_T)
156-
&& !isVariablesChanged(variable->declEndToken(), functionToken, 0 /*indirect*/, { variable }, *mSettings)) {
156+
&& !isVariablesChanged(variable->declEndToken(), functionToken, valueType->pointer, { variable }, *mSettings)) {
157157
const Token* varTok = variable->declEndToken();
158158
MathLib::bigint count = -1; // Find out explicitly set count, e.g.: char buf[3] = {...}. Variable 'count' is set to 3 then.
159159
if (varTok && Token::simpleMatch(varTok->astOperand1(), "["))

0 commit comments

Comments
 (0)