Skip to content

Commit

Permalink
Merge pull request #121 from jelu/codeql-fix
Browse files Browse the repository at this point in the history
CodeQL, code format
  • Loading branch information
jelu authored Aug 29, 2024
2 parents 5ff3004 + 1dfd47b commit 66e542a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/packetq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ int getopt_long(int argc, char* argv[], const char* str, option* opt, int* optio

void sigproc(int sig)
{
//ignore sig pipe
// ignore sig pipe
signal(SIGPIPE, sigproc);
}

Expand Down
2 changes: 1 addition & 1 deletion src/pcap.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class Pcap_file {
m_packetbuffer = 0;
}
m_packetbuffer_len = len + 4096;
m_packetbuffer = new(std::nothrow) unsigned char[m_packetbuffer_len];
m_packetbuffer = new (std::nothrow) unsigned char[m_packetbuffer_len];
if (!m_packetbuffer)
m_packetbuffer_len = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ namespace httpd {
}
void process(bool read)
{
//m_serv means this is a listening socket
// m_serv means this is a listening socket
if (m_serv)
return;
if (!read) {
Expand Down Expand Up @@ -1165,7 +1165,7 @@ void start_server(int port, bool fork_me, const std::string& pcaproot, const std
if (cnt < max_conn) {
int c = server.get_connection();
if (c > -1) {
Http_socket* s = new(std::nothrow) Http_socket(c);
Http_socket* s = new (std::nothrow) Http_socket(c);
if (s && s->failed()) {
syslog(LOG_ERR | LOG_USER, "failed to create socket");
delete s;
Expand Down
7 changes: 3 additions & 4 deletions src/sql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,7 @@ void Table::merge_sort(Ordering_terms& order)
if (p2 + l2 > table_size)
l2 = table_size - p2;

int i = start;

i = start;
while (cnt-- > 0) {
if (l1 <= 0) {
d[i++] = s[p2++];
Expand Down Expand Up @@ -2556,7 +2555,7 @@ Cc_func::Cc_func(const OP& op)
}
}

MMDB_s* mmdb = new(std::nothrow) MMDB_s;
MMDB_s* mmdb = new (std::nothrow) MMDB_s;
if (!mmdb) {
return;
}
Expand Down Expand Up @@ -2648,7 +2647,7 @@ Asn_func::Asn_func(const OP& op)
}
}

MMDB_s* mmdb = new(std::nothrow) MMDB_s;
MMDB_s* mmdb = new (std::nothrow) MMDB_s;
if (!mmdb) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/sql.h
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ class OP : public Token {
}
m_name += ")";
}
//m_name+=")";
// m_name+=")";
return m_name.c_str();
}
Coltype::Type ret_type() { return m_t; }
Expand Down
8 changes: 4 additions & 4 deletions src/tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ class Stream {
}
/// add a datasegment to the stream
/** If the segment has the expected sequence number
* the segment will be added to the list
*/
* the segment will be added to the list
*/
void add(bool syn, unsigned int seq, Data_segment& s)
{
m_content = true;
Expand Down Expand Up @@ -183,8 +183,8 @@ class Stream {
}
/// returns the data in the stream
/** The returned data is located in a static buffer shared by all streams
* the data is valid until the next call to get_buffer()
*/
* the data is valid until the next call to get_buffer()
*/
unsigned char* get_buffer()
{
int p = 0;
Expand Down

0 comments on commit 66e542a

Please sign in to comment.