Skip to content

Commit c9c159a

Browse files
committed
C++: Autoformat.
1 parent 799b932 commit c9c159a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

cpp/ql/src/semmle/code/cpp/commons/Printf.qll

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,11 @@ private predicate callsVariadicFormatter(
7171
fc.getArgument(format) = f.getParameter(formatParamIndex).getAnAccess() and
7272
not fc.getArgument(output) = f.getParameter(_).getAnAccess() and
7373
(
74-
(
75-
calledType = "" and
76-
type = ""
77-
) or (
78-
calledType != "" and
79-
type = "?" // we probably should have an `outputParamIndex` link but have lost it.
80-
)
74+
calledType = "" and
75+
type = ""
76+
or
77+
calledType != "" and
78+
type = "?" // we probably should have an `outputParamIndex` link but have lost it.
8179
) and
8280
outputParamIndex = -1
8381
)

cpp/ql/src/semmle/code/cpp/models/interfaces/FormattingFunction.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ abstract class FormattingFunction extends ArrayFunction, TaintFunction {
115115
* this function behaves like `fprintf` (see `isOutputStream`).
116116
*/
117117
int getOutputParameterIndex() { none() }
118-
118+
119119
/**
120120
* Holds if this function outputs to a global stream such as standard output,
121121
* standard error or a system log. For example `printf`.
122122
*/
123123
predicate isOutputGlobal() { none() }
124-
124+
125125
/**
126126
* Holds if this function outputs to the stream indicated by
127127
* `getOutputParameterIndex()`, that is, this function behaves like `fprintf`.
@@ -167,7 +167,9 @@ abstract class FormattingFunction extends ArrayFunction, TaintFunction {
167167

168168
override predicate hasArrayInput(int bufParam) { bufParam = getFormatParameterIndex() }
169169

170-
override predicate hasArrayOutput(int bufParam) { bufParam = getOutputParameterIndex() and not isOutputStream() }
170+
override predicate hasArrayOutput(int bufParam) {
171+
bufParam = getOutputParameterIndex() and not isOutputStream()
172+
}
171173

172174
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
173175
exists(int arg |

0 commit comments

Comments
 (0)