Skip to content

Commit 3734e1c

Browse files
authored
C++: auto format
1 parent 06acaef commit 3734e1c

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ abstract class BufferWriteEstimationReason extends TBufferWriteEstimationReason
3737

3838
/**
3939
* No particular reason given. This is currently used for backward compatibility so that
40-
* classes derived from BufferWrite and overriding getMaxData\0 still work with the
40+
* classes derived from BufferWrite and overriding getMaxData\0 still work with the
4141
* queries as intended.
4242
*/
4343
class NoSpecifiedEstimateReason extends BufferWriteEstimationReason, TNoSpecifiedEstimateReason {

cpp/ql/lib/semmle/code/cpp/security/BufferWrite.qll

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ abstract class BufferWrite extends Expr {
9696
* than their true maximum length. This can be helpful in determining the
9797
* cause of a buffer overflow issue.
9898
*/
99-
int getMaxDataLimited(BufferWriteEstimationReason reason) {
100-
result = getMaxData(reason)
101-
}
99+
int getMaxDataLimited(BufferWriteEstimationReason reason) { result = getMaxData(reason) }
102100

103101
/**
104102
* Gets the size of a single character of the type this
@@ -207,13 +205,9 @@ class StrCatBW extends BufferWriteCall {
207205
this.getArgument(this.getParamSrc()).(AnalysedString).getMaxLength() * this.getCharSize()
208206
}
209207

210-
override int getMaxData(BufferWriteEstimationReason reason) {
211-
result = getMaxDataImpl(reason)
212-
}
208+
override int getMaxData(BufferWriteEstimationReason reason) { result = getMaxDataImpl(reason) }
213209

214-
deprecated override int getMaxData() {
215-
result = max(getMaxDataImpl(_))
216-
}
210+
deprecated override int getMaxData() { result = max(getMaxDataImpl(_)) }
217211
}
218212

219213
/**
@@ -288,7 +282,9 @@ class SprintfBW extends BufferWriteCall {
288282
)
289283
}
290284

291-
override int getMaxDataLimited(BufferWriteEstimationReason reason) { result = getMaxDataLimitedImpl(reason) }
285+
override int getMaxDataLimited(BufferWriteEstimationReason reason) {
286+
result = getMaxDataLimitedImpl(reason)
287+
}
292288

293289
deprecated override int getMaxDataLimited() { result = max(getMaxDataLimitedImpl(_)) }
294290
}
@@ -399,7 +395,9 @@ class SnprintfBW extends BufferWriteCall {
399395
)
400396
}
401397

402-
override int getMaxDataLimited(BufferWriteEstimationReason reason) { result = getMaxDataLimitedImpl(reason) }
398+
override int getMaxDataLimited(BufferWriteEstimationReason reason) {
399+
result = getMaxDataLimitedImpl(reason)
400+
}
403401

404402
deprecated override int getMaxDataLimited() { result = max(getMaxDataLimitedImpl(_)) }
405403
}
@@ -499,9 +497,7 @@ class ScanfBW extends BufferWrite {
499497
)
500498
}
501499

502-
override int getMaxData(BufferWriteEstimationReason reason) {
503-
result = getMaxDataImpl(reason)
504-
}
500+
override int getMaxData(BufferWriteEstimationReason reason) { result = getMaxDataImpl(reason) }
505501

506502
deprecated override int getMaxData() { result = max(getMaxDataImpl(_)) }
507503

0 commit comments

Comments
 (0)