From 143d23c326264e2445da100489557c6e25d1027c Mon Sep 17 00:00:00 2001 From: RainRat Date: Wed, 10 Apr 2024 16:31:46 -0700 Subject: [PATCH] Fix typos and remove duplicate #include --- INSTALL-cross-linux-arm64.md | 2 +- clamdscan/proto.c | 1 - common/getopt.c | 2 +- libclamav/asn1.c | 2 +- libclamav/fmap.h | 12 ++++++------ libclamav/hashtab.c | 4 ++-- libclamav/jsparse/js-norm.c | 2 +- libclamav/pe.c | 4 ++-- libclamav_rust/src/fuzzy_hash.rs | 2 +- unit_tests/check_clamav.c | 2 +- win32/compat/strptime.c | 2 +- 11 files changed, 17 insertions(+), 18 deletions(-) diff --git a/INSTALL-cross-linux-arm64.md b/INSTALL-cross-linux-arm64.md index 8c55cde549..214941da78 100644 --- a/INSTALL-cross-linux-arm64.md +++ b/INSTALL-cross-linux-arm64.md @@ -131,7 +131,7 @@ set(CMAKE_SYSROOT /opt/aarch64-wrs-linux-sysroot) # Note, you may need to set ENABLE_JSON_SHARED if your sysroot provides libjson-c.so instead of libjson-c.a. #set(ENABLE_JSON_SHARED ON) -# You may need to set the following if CMake has some trouble finding the depenencies. +# You may need to set the following if CMake has some trouble finding the dependencies. # For example if you have `libjson-c.a` in your sysroot, here: `/opt/aarch64-wrs-linux-sysroot/usr/lib64/libjson-c.a` # then you would set: #set(JSONC_LIBRARY "/usr/lib64/libjson-c.a") diff --git a/clamdscan/proto.c b/clamdscan/proto.c index 2d6e966a5e..4c26e1695b 100644 --- a/clamdscan/proto.c +++ b/clamdscan/proto.c @@ -41,7 +41,6 @@ #include #include #include -#include #ifdef HAVE_SYS_SELECT_H #include #endif diff --git a/common/getopt.c b/common/getopt.c index ec7518a57c..7c4d02c42a 100644 --- a/common/getopt.c +++ b/common/getopt.c @@ -50,7 +50,7 @@ int getopt_reset(void) /* this is the plain old UNIX getopt, with GNU-style extensions. */ /* if you're porting some piece of UNIX software, this is all you need. */ -/* this supports GNU-style permution and optional arguments */ +/* this supports GNU-style permutation and optional arguments */ int my_getopt(int argc, char *argvc[], const char *opts) { diff --git a/libclamav/asn1.c b/libclamav/asn1.c index c8463dde6c..04d7594856 100644 --- a/libclamav/asn1.c +++ b/libclamav/asn1.c @@ -106,7 +106,7 @@ #define OID_1_3_6_1_4_1_311_12_1_2 "\x2b\x06\x01\x04\x01\x82\x37\x0c\x01\x02" #define OID_szOID_CATALOG_LIST_MEMBER OID_1_3_6_1_4_1_311_12_1_2 -/* CATALOG_LIST_MEMBER2 seems to be whats used by the SHA256-based CAT files */ +/* CATALOG_LIST_MEMBER2 seems to be what's used by the SHA256-based CAT files */ #define OID_1_3_6_1_4_1_311_12_1_3 "\x2b\x06\x01\x04\x01\x82\x37\x0c\x01\x03" #define OID_szOID_CATALOG_LIST_MEMBER2 OID_1_3_6_1_4_1_311_12_1_3 diff --git a/libclamav/fmap.h b/libclamav/fmap.h index d65fbe5d61..9e8c371390 100644 --- a/libclamav/fmap.h +++ b/libclamav/fmap.h @@ -172,7 +172,7 @@ static inline void funmap(fmap_t *m) * @param m The fmap. * @param at The map offset requested. * @param len The data length requested. - * @return const void* A pointer into to the fmap->data at the requested ofset. NULL if offset/len are not contained in the fmap. + * @return const void* A pointer into to the fmap->data at the requested offset. NULL if offset/len are not contained in the fmap. */ static inline const void *fmap_need_off(fmap_t *m, size_t at, size_t len) { @@ -190,7 +190,7 @@ static inline const void *fmap_need_off(fmap_t *m, size_t at, size_t len) * @param m The fmap. * @param at The map offset requested. * @param len The data length requested. - * @return const void* A pointer into to the fmap->data at the requested ofset. NULL if offset/len are not contained in the fmap. + * @return const void* A pointer into to the fmap->data at the requested offset. NULL if offset/len are not contained in the fmap. */ static inline const void *fmap_need_off_once(fmap_t *m, size_t at, size_t len) { @@ -228,7 +228,7 @@ static inline size_t fmap_ptr2off(const fmap_t *m, const void *ptr) * @param m The fmap. * @param ptr A pointer into the fmap->data. * @param len The data length requested. - * @return const void* A pointer into to the fmap->data at the requested ofset. NULL if offset/len are not contained in the fmap. + * @return const void* A pointer into to the fmap->data at the requested offset. NULL if offset/len are not contained in the fmap. */ static inline const void *fmap_need_ptr(fmap_t *m, const void *ptr, size_t len) { @@ -246,7 +246,7 @@ static inline const void *fmap_need_ptr(fmap_t *m, const void *ptr, size_t len) * @param m The fmap. * @param ptr A pointer into the fmap->data. * @param len The data length requested. - * @return const void* A pointer into to the fmap->data at the requested ofset. NULL if offset/len are not contained in the fmap. + * @return const void* A pointer into to the fmap->data at the requested offset. NULL if offset/len are not contained in the fmap. */ static inline const void *fmap_need_ptr_once(fmap_t *m, const void *ptr, size_t len) { @@ -370,7 +370,7 @@ static inline const void *fmap_gets(fmap_t *m, char *dst, size_t *at, size_t max * @param at The map offset requested. * @param len Maximum length of data requested. * @param[out] lenout The actual len of data available. - * @return const void* A pointer into to the fmap->data at the requested ofset. NULL if offset/len are not contained in the fmap. + * @return const void* A pointer into to the fmap->data at the requested offset. NULL if offset/len are not contained in the fmap. */ static inline const void *fmap_need_off_once_len(fmap_t *m, size_t at, size_t len, size_t *lenout) { @@ -396,7 +396,7 @@ static inline const void *fmap_need_off_once_len(fmap_t *m, size_t at, size_t le * @param ptr A pointer into the fmap->data. * @param len Maximum length of data requested. * @param[out] lenout The actual len of data available. - * @return const void* A pointer into to the fmap->data at the requested ofset. NULL if offset/len are not contained in the fmap. + * @return const void* A pointer into to the fmap->data at the requested offset. NULL if offset/len are not contained in the fmap. */ static inline const void *fmap_need_ptr_once_len(fmap_t *m, const void *ptr, size_t len, size_t *lenout) { diff --git a/libclamav/hashtab.c b/libclamav/hashtab.c index 75213217eb..808204dd70 100644 --- a/libclamav/hashtab.c +++ b/libclamav/hashtab.c @@ -477,7 +477,7 @@ const struct cli_element *cli_hashtab_insert(struct cli_hashtable *s, const char } while (tries <= s->capacity); /* no free place found*/ PROFILE_HASH_EXHAUSTED(s); - cli_dbgmsg("hashtab.c: Growing hashtable %p, because its full, old size: %zu.\n", (void *)s, s->capacity); + cli_dbgmsg("hashtab.c: Growing hashtable %p, because it's full, old size: %zu.\n", (void *)s, s->capacity); } while (cli_hashtab_grow(s) >= 0); cli_warnmsg("hashtab.c: Unable to grow hashtable\n"); return NULL; @@ -529,7 +529,7 @@ cl_error_t cli_htu32_insert(struct cli_htu32 *s, const struct cli_htu32_element } while (tries <= s->capacity); /* no free place found*/ PROFILE_HASH_EXHAUSTED(s); - cli_dbgmsg("hashtab.c: Growing hashtable %p, because its full, old size: %zu.\n", (void *)s, s->capacity); + cli_dbgmsg("hashtab.c: Growing hashtable %p, because it's full, old size: %zu.\n", (void *)s, s->capacity); } while ((ret = cli_htu32_grow(s, mempool)) >= 0); cli_warnmsg("hashtab.c: Unable to grow hashtable\n"); return ret; diff --git a/libclamav/jsparse/js-norm.c b/libclamav/jsparse/js-norm.c index a958028385..c105b2d70a 100644 --- a/libclamav/jsparse/js-norm.c +++ b/libclamav/jsparse/js-norm.c @@ -1766,7 +1766,7 @@ static int yylex(YYSTYPE *lvalp, yyscan_t scanner) cli_dbgmsg(MODULE "infloop detected, skipping character\n"); scanner->pos++; } - /* its not necessarily an infloop if it changed + /* it's not necessarily an infloop if it changed * state, and it shouldn't infloop between states */ } scanner->lastpos = scanner->pos; diff --git a/libclamav/pe.c b/libclamav/pe.c index b0cc9f4a9b..681a41a4d0 100644 --- a/libclamav/pe.c +++ b/libclamav/pe.c @@ -5797,12 +5797,12 @@ cl_error_t cli_check_auth_header(cli_ctx *ctx, struct cli_exe_info *peinfo) * If the section hashes are to be computed and returned, this function * allocates memory for the section hashes, and it's up to the caller to free * it. hashes->sections will be initialized to NULL at the beginning of the - * function, and if after the call it's value is non-NULL, the memory should be + * function, and if after the call its value is non-NULL, the memory should be * freed. Furthermore, if hashes->sections is non-NULL, the hashes can assume * to be valid regardless of the return code. * * Also, a few other notes: - * - If a section has a virtual size of zero, it's corresponding hash value + * - If a section has a virtual size of zero, its corresponding hash value * will not be computed and the hash contents will be all zeroes. * - If a section extends beyond the end of the file, the section data and * length will be truncated, and the hash generated accordingly diff --git a/libclamav_rust/src/fuzzy_hash.rs b/libclamav_rust/src/fuzzy_hash.rs index fb5c62d956..9c260a0ffd 100644 --- a/libclamav_rust/src/fuzzy_hash.rs +++ b/libclamav_rust/src/fuzzy_hash.rs @@ -536,7 +536,7 @@ fn rgb_to_luma(rgb: &[u8]) -> u8 { /// Convert the supplied image to grayscale. Alpha channel is discarded. /// -/// This is a customized implemententation of the grayscale feature from the `image` crate. +/// This is a customized implementation of the grayscale feature from the `image` crate. /// This allows us to: /// - use RGB->LUMA constants that match those used by the Python Pillow package. /// - round the luma floating point value to the nearest integer rather than truncating. diff --git a/unit_tests/check_clamav.c b/unit_tests/check_clamav.c index 36e9a08e10..1e341e7ddd 100644 --- a/unit_tests/check_clamav.c +++ b/unit_tests/check_clamav.c @@ -1270,7 +1270,7 @@ START_TEST(test_fmap_assorted_api) free_duplicate_fmap(dup_map); dup_map = NULL; - /* We can close the fd-based map now that we're done with it's duplicate */ + /* We can close the fd-based map now that we're done with its duplicate */ cl_fmap_close(fd_based_map); fd_based_map = NULL; diff --git a/win32/compat/strptime.c b/win32/compat/strptime.c index a35c5b393a..b577b872ee 100644 --- a/win32/compat/strptime.c +++ b/win32/compat/strptime.c @@ -190,7 +190,7 @@ static const unsigned short int __mon_yday[2][13] = static void day_of_the_week(struct tm *tm) { - /* We know that January 1st 1970 was a Thursday (= 4). Compute the + /* We know that January 1st 1970 was a Thursday (= 4). Compute the difference between this data in the one on TM and so determine the weekday. */ int corr_year = 1900 + tm->tm_year - (tm->tm_mon < 2);