From dd6baccabd064f0d725625643b7087c6a32d994f Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Mon, 5 Jan 2026 22:08:34 +0100 Subject: [PATCH] src: doc: remove more double-space typos Found with git grep -E '[a-z] [a-z]' --- doc/userguide/devguide/codebase/code-style.rst | 2 +- ebpf/lb.c | 2 +- etc/schema.json | 8 ++++---- plugins/napatech/source-napatech.c | 2 +- plugins/napatech/util-napatech.c | 2 +- rules/app-layer-events.rules | 2 +- rules/http-events.rules | 2 +- rules/smtp-events.rules | 2 +- rules/tls-events.rules | 2 +- src/detect-bytetest.c | 2 +- src/detect-engine-event.c | 7 +++---- src/detect-gid.c | 2 +- src/detect-ipopts.c | 2 +- src/detect.h | 2 +- src/source-af-packet.c | 2 +- src/stream-tcp.c | 2 +- src/tests/detect-parse.c | 2 +- src/util-ebpf.c | 4 ++-- src/util-mpm-hs.c | 2 +- src/util-unittest.c | 6 ++++-- 20 files changed, 29 insertions(+), 28 deletions(-) diff --git a/doc/userguide/devguide/codebase/code-style.rst b/doc/userguide/devguide/codebase/code-style.rst index fe74705791..b1f271b2a6 100644 --- a/doc/userguide/devguide/codebase/code-style.rst +++ b/doc/userguide/devguide/codebase/code-style.rst @@ -538,7 +538,7 @@ We use ``/* foobar */`` style and try to avoid ``//`` style. File names ********** -File names are all lowercase and have a .c. .h or .rs (Rust) extension. +File names are all lowercase and have a .c .h or .rs (Rust) extension. Most files have a _subsystem_ prefix, e.g. ``detect-dsize.c, util-ip.c`` diff --git a/ebpf/lb.c b/ebpf/lb.c index e95a409f5e..61bd753b5a 100644 --- a/ebpf/lb.c +++ b/ebpf/lb.c @@ -54,7 +54,7 @@ static __always_inline int ipv4_hash(struct __sk_buff *skb) //char fmt2[] = "Got hash %u\n"; //bpf_trace_printk(fmt2, sizeof(fmt2), src + dst); #endif - return src + dst; + return src + dst; } static inline __u32 ipv6_addr_hash(struct __sk_buff *ctx, __u64 off) diff --git a/etc/schema.json b/etc/schema.json index ce25e458a2..bce75a1077 100644 --- a/etc/schema.json +++ b/etc/schema.json @@ -6509,7 +6509,7 @@ }, "version0_malformed_sre_hdr": { "type": "integer", - "description": "Number of packets of with version 0 and malformed SRE header for GRE" + "description": "Number of packets of with version 0 and malformed SRE header for GRE" }, "version0_recur": { "type": "integer", @@ -6529,7 +6529,7 @@ }, "version1_malformed_sre_hdr": { "type": "integer", - "description": "Number of packets with version 1 and malformed SRE header for GRE" + "description": "Number of packets with version 1 and malformed SRE header for GRE" }, "version1_no_key": { "type": "integer", @@ -7096,11 +7096,11 @@ }, "max_mac_addrs_dst": { "type": "integer", - "description": "Maximum amount of destination MAC addresses seen per flow (only if ethernet header logging enabled)" + "description": "Maximum amount of destination MAC addresses seen per flow (only if ethernet header logging enabled)" }, "max_mac_addrs_src": { "type": "integer", - "description": "Maximum amount of source MAC addresses seen per flow (only if ethernet header logging enabled)" + "description": "Maximum amount of source MAC addresses seen per flow (only if ethernet header logging enabled)" }, "max_pkt_size": { "type": "integer", diff --git a/plugins/napatech/source-napatech.c b/plugins/napatech/source-napatech.c index ac66aa0b85..c4e10fc567 100644 --- a/plugins/napatech/source-napatech.c +++ b/plugins/napatech/source-napatech.c @@ -135,7 +135,7 @@ static TmEcode NapatechStreamDeInit(void) } /** - * \brief Register the Napatech receiver (reader) module. + * \brief Register the Napatech receiver (reader) module. */ void TmModuleReceiveNapatechRegister(int slot) { diff --git a/plugins/napatech/util-napatech.c b/plugins/napatech/util-napatech.c index 059ce962f4..4db52c886f 100644 --- a/plugins/napatech/util-napatech.c +++ b/plugins/napatech/util-napatech.c @@ -862,7 +862,7 @@ int NapatechGetStreamConfig(NapatechStreamConfig stream_config[]) continue; } - /* if we get here it is an active stream */ + /* if we get here it is an active stream */ stream_config[instance_cnt].stream_id = stream_id++; stream_config[instance_cnt].is_active = true; instance_cnt++; diff --git a/rules/app-layer-events.rules b/rules/app-layer-events.rules index 6d2d470dbe..1a792d9840 100644 --- a/rules/app-layer-events.rules +++ b/rules/app-layer-events.rules @@ -1,4 +1,4 @@ -# App layer event rules +# App layer event rules # # SID's fall in the 2260000+ range. See http://doc.emergingthreats.net/bin/view/Main/SidAllocation # diff --git a/rules/http-events.rules b/rules/http-events.rules index 7e4d1fd258..0815edfee9 100644 --- a/rules/http-events.rules +++ b/rules/http-events.rules @@ -1,4 +1,4 @@ -# HTTP event rules +# HTTP event rules # # SID's fall in the 2221000+ range. See http://doc.emergingthreats.net/bin/view/Main/SidAllocation # diff --git a/rules/smtp-events.rules b/rules/smtp-events.rules index 2898bdc299..a68010dd60 100644 --- a/rules/smtp-events.rules +++ b/rules/smtp-events.rules @@ -1,4 +1,4 @@ -# SMTP event rules +# SMTP event rules # # SID's fall in the 2220000+ range. See http://doc.emergingthreats.net/bin/view/Main/SidAllocation # diff --git a/rules/tls-events.rules b/rules/tls-events.rules index ab45ba5a19..c655570a1a 100644 --- a/rules/tls-events.rules +++ b/rules/tls-events.rules @@ -1,4 +1,4 @@ -# TLS event rules +# TLS event rules # # SID's fall in the 2230000+ range. See http://doc.emergingthreats.net/bin/view/Main/SidAllocation # diff --git a/src/detect-bytetest.c b/src/detect-bytetest.c index e73b9bdd1b..95cff28930 100644 --- a/src/detect-bytetest.c +++ b/src/detect-bytetest.c @@ -335,7 +335,7 @@ static DetectBytetestData *DetectBytetestParse( goto error; } - /* Subtract two since two values are conjoined */ + /* Subtract two since two values are conjoined */ for (i = 0; i < (ret - 1); i++) { res = pcre2_substring_get_bynumber(match, i + 1, (PCRE2_UCHAR8 **)&str_ptr, &pcre2_len); if (res < 0) { diff --git a/src/detect-engine-event.c b/src/detect-engine-event.c index 58189a0597..6aad794710 100644 --- a/src/detect-engine-event.c +++ b/src/detect-engine-event.c @@ -351,7 +351,7 @@ static int DetectStreamEventSetup (DetectEngineCtx *de_ctx, Signature *s, const #ifdef UNITTESTS /** - * \test EngineEventTestParse01 is a test for a valid decode-event value + * \test EngineEventTestParse01 is a test for a valid decode-event value */ static int EngineEventTestParse01 (void) { @@ -364,9 +364,8 @@ static int EngineEventTestParse01 (void) PASS; } - /** - * \test EngineEventTestParse02 is a test for a valid upper + lower case decode-event value + * \test EngineEventTestParse02 is a test for a valid upper + lower case decode-event value */ static int EngineEventTestParse02 (void) { @@ -380,7 +379,7 @@ static int EngineEventTestParse02 (void) } /** - * \test EngineEventTestParse03 is a test for a valid upper case decode-event value + * \test EngineEventTestParse03 is a test for a valid upper case decode-event value */ static int EngineEventTestParse03 (void) { diff --git a/src/detect-gid.c b/src/detect-gid.c index 9f346f1050..c4ab77db73 100644 --- a/src/detect-gid.c +++ b/src/detect-gid.c @@ -92,7 +92,7 @@ static int DetectGidSetup (DetectEngineCtx *de_ctx, Signature *s, const char *ra #ifdef UNITTESTS /** - * \test GidTestParse01 is a test for a valid gid value + * \test GidTestParse01 is a test for a valid gid value */ static int GidTestParse01 (void) { diff --git a/src/detect-ipopts.c b/src/detect-ipopts.c index 7dc8bb2cb6..0a88e241eb 100644 --- a/src/detect-ipopts.c +++ b/src/detect-ipopts.c @@ -255,7 +255,7 @@ void DetectIpOptsFree(DetectEngineCtx *de_ctx, void *de_ptr) #ifdef UNITTESTS /** - * \test IpOptsTestParse01 is a test for a valid ipopts value + * \test IpOptsTestParse01 is a test for a valid ipopts value */ static int IpOptsTestParse01 (void) { diff --git a/src/detect.h b/src/detect.h index 2cf6becb8f..4b15bc159c 100644 --- a/src/detect.h +++ b/src/detect.h @@ -1424,7 +1424,7 @@ typedef struct SigTableElmt_ { uint8_t flags, void *alstate, void *txv, const Signature *, const SigMatchCtx *); - /** File match function pointer */ + /** File match function pointer */ int (*FileMatch)(DetectEngineThreadCtx *, Flow *, /**< *LOCKED* flow */ uint8_t flags, File *, const Signature *, const SigMatchCtx *); diff --git a/src/source-af-packet.c b/src/source-af-packet.c index 43126183a4..1967ce5656 100644 --- a/src/source-af-packet.c +++ b/src/source-af-packet.c @@ -2111,7 +2111,7 @@ error: TmEcode AFPSetBPFFilter(AFPThreadVars *ptv) { struct bpf_program filter; - struct sock_fprog fcode; + struct sock_fprog fcode; int rc; #ifdef HAVE_PACKET_EBPF diff --git a/src/stream-tcp.c b/src/stream-tcp.c index d169e46e26..034a942b11 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -2388,7 +2388,7 @@ static int StreamTcpPacketStateSynSent( StreamTcp3whsStoreSynApplyToSsn(ssn, &syn_pkt); } } else if (tcph->th_flags & TH_ACK) { - /* Handle the asynchronous stream, when we receive a SYN packet + /* Handle the asynchronous stream, when we receive a SYN packet and now instead of receiving a SYN/ACK we receive a ACK from the same host, which sent the SYN, this suggests the ASYNC streams.*/ if (!stream_config.async_oneside) diff --git a/src/tests/detect-parse.c b/src/tests/detect-parse.c index 694e2ae236..9a39116d4c 100644 --- a/src/tests/detect-parse.c +++ b/src/tests/detect-parse.c @@ -42,7 +42,7 @@ static int DetectParseTest01 (void) } /** - * \test DetectParseTestNoOpt is a regression test to make sure that we reject + * \test DetectParseTestNoOpt is a regression test to make sure that we reject * any signature where a NOOPT rule option is given a value. This can hide rule * errors which make other options disappear, eg: foo: bar: baz; where "foo" is * the NOOPT option, we will end up with a signature which is missing "bar". diff --git a/src/util-ebpf.c b/src/util-ebpf.c index e6f5e7fe91..628562f475 100644 --- a/src/util-ebpf.c +++ b/src/util-ebpf.c @@ -837,7 +837,7 @@ static int EBPFForEachFlowV6Table(ThreadVars *th_v, bytes_cnt += BPF_PERCPU(values_array, i).bytes; } /* Get the corresponding Flow in the Flow table to compare and update - * its counters and lastseen if needed */ + * its counters and lastseen if needed */ FlowKey flow_key; if (tcfg->mode == AFP_MODE_XDP_BYPASS) { flow_key.sp = ntohs(next_key.port16[0]); @@ -992,7 +992,7 @@ void EBPFBuildCPUSet(SCConfNode *node, char *iface) * Setup peer interface in XDP system * * Ths function set up the peer interface in the XDP maps used by the - * bypass filter. The first map tx_peer has type device map and is + * bypass filter. The first map tx_peer has type device map and is * used to store the peer. The second map tx_peer_int is used by the * code to check if we have a peer defined for this interface. * diff --git a/src/util-mpm-hs.c b/src/util-mpm-hs.c index ba22c362a3..857391c635 100644 --- a/src/util-mpm-hs.c +++ b/src/util-mpm-hs.c @@ -838,7 +838,7 @@ static int SCHSCacheRuleset(MpmConfig *mpm_conf) SCLogDebug("Caching the loaded ruleset to %s", mpm_conf->cache_dir_path); if (SCCreateDirectoryTree(mpm_conf->cache_dir_path, true) != 0) { SCLogWarning("Failed to create Hyperscan cache folder, make sure " - "the parent folder is writeable " + "the parent folder is writeable " "or adjust sgh-mpm-caching-path setting (%s)", mpm_conf->cache_dir_path); return -1; diff --git a/src/util-unittest.c b/src/util-unittest.c index 7f764fd5c7..7f20b51ba9 100644 --- a/src/util-unittest.c +++ b/src/util-unittest.c @@ -297,7 +297,8 @@ void UtRunModeRegister(void) static int UtSelftestTrue(void) { if (1)return 1; - else return 0; + else + return 0; } /** \brief False test @@ -308,7 +309,8 @@ static int UtSelftestTrue(void) static int UtSelftestFalse(void) { if (0)return 0; - else return 1; + else + return 1; } /** \brief Run self tests