aboutgitcodebugslistschat
path: root/conf.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-01-30 02:59:12 +0100
committerStefano Brivio <sbrivio@redhat.com>2022-01-30 02:59:12 +0100
commit292c1855531df7baab095ef608cda7240984340b (patch)
treedd5bc98e5b9beaf7721c87542fe37485dd712f37 /conf.c
parent20d271b22604fc11a0b75fee52b89a6654c67db6 (diff)
downloadpasst-292c1855531df7baab095ef608cda7240984340b.tar
passt-292c1855531df7baab095ef608cda7240984340b.tar.gz
passt-292c1855531df7baab095ef608cda7240984340b.tar.bz2
passt-292c1855531df7baab095ef608cda7240984340b.tar.lz
passt-292c1855531df7baab095ef608cda7240984340b.tar.xz
passt-292c1855531df7baab095ef608cda7240984340b.tar.zst
passt-292c1855531df7baab095ef608cda7240984340b.zip
passt: Address new clang-tidy warnings from LLVM 13.0.1
clang-tidy from LLVM 13.0.1 reports some new warnings from these checkers: - altera-unroll-loops, altera-id-dependent-backward-branch: ignore for the moment being, add a TODO item - bugprone-easily-swappable-parameters: ignore, nothing to do about those - readability-function-cognitive-complexity: ignore for the moment being, add a TODO item - altera-struct-pack-align: ignore, alignment is forced in protocol headers - concurrency-mt-unsafe: ignore for the moment being, add a TODO item Fix bugprone-implicit-widening-of-multiplication-result warnings, though, that's doable and they seem to make sense. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/conf.c b/conf.c
index 9a9dade..abe63a1 100644
--- a/conf.c
+++ b/conf.c
@@ -867,7 +867,7 @@ void conf(struct ctx *c, int argc, char **argv)
for (i = 0; i < ETH_ALEN; i++) {
errno = 0;
- b = strtol(optarg + i * 3, NULL, 16);
+ b = strtol(optarg + (intptr_t)i * 3, NULL, 16);
if (b < 0 || b > UCHAR_MAX || errno) {
err("Invalid MAC address: %s", optarg);
usage(argv[0]);
@@ -1032,7 +1032,7 @@ void conf(struct ctx *c, int argc, char **argv)
case 'M':
for (i = 0; i < ETH_ALEN; i++) {
errno = 0;
- b = strtol(optarg + i * 3, NULL, 16);
+ b = strtol(optarg + (intptr_t)i * 3, NULL, 16);
if (b < 0 || b > UCHAR_MAX || errno) {
err("Invalid MAC address: %s", optarg);
usage(argv[0]);