Skip to content

Commit 1dfd47b

Browse files
committed
CodeQL, code format
- Fix CodeQL issue https://github.com/DNS-OARC/PacketQ/security/code-scanning/5 - Format code
1 parent 5ff3004 commit 1dfd47b

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

Diff for: src/packetq.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ int getopt_long(int argc, char* argv[], const char* str, option* opt, int* optio
139139

140140
void sigproc(int sig)
141141
{
142-
//ignore sig pipe
142+
// ignore sig pipe
143143
signal(SIGPIPE, sigproc);
144144
}
145145

Diff for: src/pcap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ class Pcap_file {
178178
m_packetbuffer = 0;
179179
}
180180
m_packetbuffer_len = len + 4096;
181-
m_packetbuffer = new(std::nothrow) unsigned char[m_packetbuffer_len];
181+
m_packetbuffer = new (std::nothrow) unsigned char[m_packetbuffer_len];
182182
if (!m_packetbuffer)
183183
m_packetbuffer_len = 0;
184184
}

Diff for: src/server.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ namespace httpd {
230230
}
231231
void process(bool read)
232232
{
233-
//m_serv means this is a listening socket
233+
// m_serv means this is a listening socket
234234
if (m_serv)
235235
return;
236236
if (!read) {
@@ -1165,7 +1165,7 @@ void start_server(int port, bool fork_me, const std::string& pcaproot, const std
11651165
if (cnt < max_conn) {
11661166
int c = server.get_connection();
11671167
if (c > -1) {
1168-
Http_socket* s = new(std::nothrow) Http_socket(c);
1168+
Http_socket* s = new (std::nothrow) Http_socket(c);
11691169
if (s && s->failed()) {
11701170
syslog(LOG_ERR | LOG_USER, "failed to create socket");
11711171
delete s;

Diff for: src/sql.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,7 @@ void Table::merge_sort(Ordering_terms& order)
531531
if (p2 + l2 > table_size)
532532
l2 = table_size - p2;
533533

534-
int i = start;
535-
534+
i = start;
536535
while (cnt-- > 0) {
537536
if (l1 <= 0) {
538537
d[i++] = s[p2++];
@@ -2556,7 +2555,7 @@ Cc_func::Cc_func(const OP& op)
25562555
}
25572556
}
25582557

2559-
MMDB_s* mmdb = new(std::nothrow) MMDB_s;
2558+
MMDB_s* mmdb = new (std::nothrow) MMDB_s;
25602559
if (!mmdb) {
25612560
return;
25622561
}
@@ -2648,7 +2647,7 @@ Asn_func::Asn_func(const OP& op)
26482647
}
26492648
}
26502649

2651-
MMDB_s* mmdb = new(std::nothrow) MMDB_s;
2650+
MMDB_s* mmdb = new (std::nothrow) MMDB_s;
26522651
if (!mmdb) {
26532652
return;
26542653
}

Diff for: src/sql.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ class OP : public Token {
668668
}
669669
m_name += ")";
670670
}
671-
//m_name+=")";
671+
// m_name+=")";
672672
return m_name.c_str();
673673
}
674674
Coltype::Type ret_type() { return m_t; }

Diff for: src/tcp.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ class Stream {
130130
}
131131
/// add a datasegment to the stream
132132
/** If the segment has the expected sequence number
133-
* the segment will be added to the list
134-
*/
133+
* the segment will be added to the list
134+
*/
135135
void add(bool syn, unsigned int seq, Data_segment& s)
136136
{
137137
m_content = true;
@@ -183,8 +183,8 @@ class Stream {
183183
}
184184
/// returns the data in the stream
185185
/** The returned data is located in a static buffer shared by all streams
186-
* the data is valid until the next call to get_buffer()
187-
*/
186+
* the data is valid until the next call to get_buffer()
187+
*/
188188
unsigned char* get_buffer()
189189
{
190190
int p = 0;

0 commit comments

Comments
 (0)