Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3a6a515

Browse files
committed
C++: Tabs to spaces and // Bug comments in test
This changes the column numbers in the expected test output.
1 parent aafb4ab commit 3a6a515

3 files changed

Lines changed: 52 additions & 52 deletions

File tree

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
| test.c:34:9:34:14 | call to strcpy | Return Value of strcpy used directly in a conditional expression. |
2-
| test.c:38:9:38:31 | ! ... | Return Value of strcpy used in a logical operation. |
3-
| test.c:42:9:42:35 | ... == ... | Return Value of strcpy used in a logical operation. |
4-
| test.c:46:9:46:48 | ... && ... | Return Value of strcpy used in a logical operation. |
5-
| test.c:50:9:50:15 | call to strncpy | Return Value of strncpy used directly in a conditional expression. |
6-
| test.c:54:6:54:34 | ! ... | Return Value of strncpy used in a logical operation. |
7-
| test.c:58:11:58:39 | ! ... | Return Value of strncpy used in a logical operation. |
8-
| test.c:60:11:60:37 | ... && ... | Return Value of strcpy used in a logical operation. |
9-
| test.c:62:11:62:37 | ... == ... | Return Value of strcpy used in a logical operation. |
10-
| test.c:64:11:64:37 | ... != ... | Return Value of strcpy used in a logical operation. |
11-
| test.cpp:75:9:75:14 | call to strcpy | Return Value of strcpy used directly in a conditional expression. |
12-
| test.cpp:79:9:79:31 | ! ... | Return Value of strcpy used in a logical operation. |
13-
| test.cpp:79:10:79:15 | call to strcpy | Return Value of strcpy used as boolean. |
14-
| test.cpp:83:9:83:35 | ... == ... | Return Value of strcpy used in a logical operation. |
15-
| test.cpp:87:9:87:48 | ... && ... | Return Value of strcpy used in a logical operation. |
16-
| test.cpp:87:27:87:32 | call to strcpy | Return Value of strcpy used as boolean. |
17-
| test.cpp:91:9:91:37 | call to wcscpy | Return Value of wcscpy used directly in a conditional expression. |
18-
| test.cpp:95:9:95:14 | call to wcscpy | Return Value of wcscpy used directly in a conditional expression. |
19-
| test.cpp:99:9:99:15 | call to _mbscpy | Return Value of _mbscpy used directly in a conditional expression. |
20-
| test.cpp:103:9:103:15 | call to strncpy | Return Value of strncpy used directly in a conditional expression. |
21-
| test.cpp:107:9:107:15 | call to wcsncpy | Return Value of wcsncpy used directly in a conditional expression. |
22-
| test.cpp:111:9:111:16 | call to _mbsncpy | Return Value of _mbsncpy used directly in a conditional expression. |
23-
| test.cpp:115:9:115:18 | call to _strncpy_l | Return Value of _strncpy_l used directly in a conditional expression. |
24-
| test.cpp:119:9:119:18 | call to _wcsncpy_l | Return Value of _wcsncpy_l used directly in a conditional expression. |
25-
| test.cpp:123:9:123:18 | call to _mbsncpy_l | Return Value of _mbsncpy_l used directly in a conditional expression. |
26-
| test.cpp:127:6:127:34 | ! ... | Return Value of strncpy used in a logical operation. |
27-
| test.cpp:127:7:127:13 | call to strncpy | Return Value of strncpy used as boolean. |
28-
| test.cpp:131:11:131:17 | call to strncpy | Return Value of strncpy used as boolean. |
29-
| test.cpp:133:16:133:44 | ! ... | Return Value of strncpy used in a logical operation. |
30-
| test.cpp:133:17:133:23 | call to strncpy | Return Value of strncpy used as boolean. |
31-
| test.cpp:135:11:135:16 | call to strcpy | Return Value of strcpy used as boolean. |
32-
| test.cpp:135:11:135:37 | ... && ... | Return Value of strcpy used in a logical operation. |
33-
| test.cpp:137:11:137:37 | ... == ... | Return Value of strcpy used in a logical operation. |
34-
| test.cpp:139:11:139:37 | ... != ... | Return Value of strcpy used in a logical operation. |
1+
| test.c:34:9:34:14 | call to strcpy | Return value of strcpy used directly in a conditional expression. |
2+
| test.c:38:9:38:31 | ! ... | Return value of strcpy used in a logical operation. |
3+
| test.c:42:9:42:35 | ... == ... | Return value of strcpy used in a logical operation. |
4+
| test.c:46:9:46:48 | ... && ... | Return value of strcpy used in a logical operation. |
5+
| test.c:50:9:50:15 | call to strncpy | Return value of strncpy used directly in a conditional expression. |
6+
| test.c:54:9:54:37 | ! ... | Return value of strncpy used in a logical operation. |
7+
| test.c:58:14:58:42 | ! ... | Return value of strncpy used in a logical operation. |
8+
| test.c:60:14:60:40 | ... && ... | Return value of strcpy used in a logical operation. |
9+
| test.c:62:14:62:40 | ... == ... | Return value of strcpy used in a logical operation. |
10+
| test.c:64:14:64:40 | ... != ... | Return value of strcpy used in a logical operation. |
11+
| test.cpp:75:9:75:14 | call to strcpy | Return value of strcpy used directly in a conditional expression. |
12+
| test.cpp:79:9:79:31 | ! ... | Return value of strcpy used in a logical operation. |
13+
| test.cpp:79:10:79:15 | call to strcpy | Return value of strcpy used as Boolean. |
14+
| test.cpp:83:9:83:35 | ... == ... | Return value of strcpy used in a logical operation. |
15+
| test.cpp:87:9:87:48 | ... && ... | Return value of strcpy used in a logical operation. |
16+
| test.cpp:87:27:87:32 | call to strcpy | Return value of strcpy used as Boolean. |
17+
| test.cpp:91:9:91:37 | call to wcscpy | Return value of wcscpy used directly in a conditional expression. |
18+
| test.cpp:95:9:95:14 | call to wcscpy | Return value of wcscpy used directly in a conditional expression. |
19+
| test.cpp:99:9:99:15 | call to _mbscpy | Return value of _mbscpy used directly in a conditional expression. |
20+
| test.cpp:103:9:103:15 | call to strncpy | Return value of strncpy used directly in a conditional expression. |
21+
| test.cpp:107:9:107:15 | call to wcsncpy | Return value of wcsncpy used directly in a conditional expression. |
22+
| test.cpp:111:9:111:16 | call to _mbsncpy | Return value of _mbsncpy used directly in a conditional expression. |
23+
| test.cpp:115:9:115:18 | call to _strncpy_l | Return value of _strncpy_l used directly in a conditional expression. |
24+
| test.cpp:119:9:119:18 | call to _wcsncpy_l | Return value of _wcsncpy_l used directly in a conditional expression. |
25+
| test.cpp:123:9:123:18 | call to _mbsncpy_l | Return value of _mbsncpy_l used directly in a conditional expression. |
26+
| test.cpp:127:9:127:37 | ! ... | Return value of strncpy used in a logical operation. |
27+
| test.cpp:127:10:127:16 | call to strncpy | Return value of strncpy used as Boolean. |
28+
| test.cpp:131:14:131:20 | call to strncpy | Return value of strncpy used as Boolean. |
29+
| test.cpp:133:19:133:47 | ! ... | Return value of strncpy used in a logical operation. |
30+
| test.cpp:133:20:133:26 | call to strncpy | Return value of strncpy used as Boolean. |
31+
| test.cpp:135:14:135:19 | call to strcpy | Return value of strcpy used as Boolean. |
32+
| test.cpp:135:14:135:40 | ... && ... | Return value of strcpy used in a logical operation. |
33+
| test.cpp:137:14:137:40 | ... == ... | Return value of strcpy used in a logical operation. |
34+
| test.cpp:139:14:139:40 | ... != ... | Return value of strcpy used in a logical operation. |

cpp/ql/test/query-tests/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean/test.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void PositiveCases()
2929
{
3030
char szbuf1[100];
3131
char szbuf2[100];
32-
int result;
32+
int result;
3333

3434
if (strcpy(szbuf1, "test")) // Bug, direct usage
3535
{
@@ -51,17 +51,17 @@ void PositiveCases()
5151
{
5252
}
5353

54-
if (!strncpy(szbuf1, "test", 100)) // Bug
55-
{
56-
}
54+
if (!strncpy(szbuf1, "test", 100)) // Bug
55+
{
56+
}
5757

58-
result = !strncpy(szbuf1, "test", 100);
58+
result = !strncpy(szbuf1, "test", 100); // Bug
5959

60-
result = strcpy(szbuf1, "test") && 1;
60+
result = strcpy(szbuf1, "test") && 1; // Bug
6161

62-
result = strcpy(szbuf1, "test") == 0;
62+
result = strcpy(szbuf1, "test") == 0; // Bug
6363

64-
result = strcpy(szbuf1, "test") != 0;
64+
result = strcpy(szbuf1, "test") != 0; // Bug
6565
}
6666

6767
void NegativeCases()
@@ -80,4 +80,4 @@ void NegativeCases()
8080
{
8181
}
8282

83-
}
83+
}

cpp/ql/test/query-tests/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean/test.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,19 @@ void PositiveCases()
124124
{
125125
}
126126

127-
if (!strncpy(szbuf1, "test", 100)) // Bug
128-
{
129-
}
127+
if (!strncpy(szbuf1, "test", 100)) // Bug
128+
{
129+
}
130130

131-
bool b = strncpy(szbuf1, "test", 100);
131+
bool b = strncpy(szbuf1, "test", 100); // Bug
132132

133-
bool result = !strncpy(szbuf1, "test", 100);
133+
bool result = !strncpy(szbuf1, "test", 100); // Bug
134134

135-
result = strcpy(szbuf1, "test") && 1;
135+
result = strcpy(szbuf1, "test") && 1; // Bug
136136

137-
result = strcpy(szbuf1, "test") == 0;
137+
result = strcpy(szbuf1, "test") == 0; // Bug
138138

139-
result = strcpy(szbuf1, "test") != 0;
139+
result = strcpy(szbuf1, "test") != 0; // Bug
140140

141141
}
142142

@@ -160,4 +160,4 @@ void NegativeCases()
160160
{
161161
}
162162

163-
}
163+
}

0 commit comments

Comments
 (0)