aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2022-01-11 12:18:35 -0500
committerLibravatar netblue30 <netblue30@protonmail.com>2022-01-11 12:18:35 -0500
commit782b7cefbf8923700d6cd2777e7ccbdeda7f6ce0 (patch)
treea8b0af0ad702234837e4b8b5983fc3804a5b019f /src
parentremove compile warning (diff)
downloadfirejail-782b7cefbf8923700d6cd2777e7ccbdeda7f6ce0.tar.gz
firejail-782b7cefbf8923700d6cd2777e7ccbdeda7f6ce0.tar.zst
firejail-782b7cefbf8923700d6cd2777e7ccbdeda7f6ce0.zip
fix scan-build/cppcheck warnings
Diffstat (limited to 'src')
-rw-r--r--src/fcopy/main.c3
-rw-r--r--src/fnettrace/hostnames2
-rw-r--r--src/fnettrace/main.c7
3 files changed, 6 insertions, 6 deletions
diff --git a/src/fcopy/main.c b/src/fcopy/main.c
index a9443a764..c64d20127 100644
--- a/src/fcopy/main.c
+++ b/src/fcopy/main.c
@@ -200,7 +200,8 @@ static char *proc_pid_to_self(const char *target) {
200 200
201 // check where /proc/self points to 201 // check where /proc/self points to
202 static const char proc_self[] = "/proc/self"; 202 static const char proc_self[] = "/proc/self";
203 if (!(proc_pid = realpath(proc_self, NULL))) 203 proc_pid = realpath(proc_self, NULL);
204 if (proc_pid == NULL)
204 goto done; 205 goto done;
205 206
206 // redirect /proc/PID/xxx -> /proc/self/XXX 207 // redirect /proc/PID/xxx -> /proc/self/XXX
diff --git a/src/fnettrace/hostnames b/src/fnettrace/hostnames
index 6b7a19689..a808a3b09 100644
--- a/src/fnettrace/hostnames
+++ b/src/fnettrace/hostnames
@@ -66,7 +66,7 @@
669.9.9.0/24 Quad9 DNS 669.9.9.0/24 Quad9 DNS
6745.90.28.0/22 NextDNS 6745.90.28.0/22 NextDNS
68149.112.112.0/24 Quad9 DNS 68149.112.112.0/24 Quad9 DNS
69149.112.120.0/21 CIRA DNS Csnada 69149.112.120.0/21 CIRA DNS Canada
70176.103.128.0/19 Adguard DNS 70176.103.128.0/19 Adguard DNS
71185.228.168.0/24 Cleanbrowsing DNS 71185.228.168.0/24 Cleanbrowsing DNS
72193.0.0.0/21 whois.ripe.net Netherlands 72193.0.0.0/21 whois.ripe.net Netherlands
diff --git a/src/fnettrace/main.c b/src/fnettrace/main.c
index 40025590e..ab65268fd 100644
--- a/src/fnettrace/main.c
+++ b/src/fnettrace/main.c
@@ -221,16 +221,15 @@ static void hnode_print(unsigned bw) {
221 bw = adjust_bandwidth(bw); 221 bw = adjust_bandwidth(bw);
222 char stats[31]; 222 char stats[31];
223 if (bw > (1024 * 1024 * DISPLAY_INTERVAL)) 223 if (bw > (1024 * 1024 * DISPLAY_INTERVAL))
224 sprintf(stats, "%d MB/s ", bw / (1024 * 1024 * DISPLAY_INTERVAL)); 224 sprintf(stats, "%u MB/s ", bw / (1024 * 1024 * DISPLAY_INTERVAL));
225 else 225 else
226 sprintf(stats, "%d KB/s ", bw / (1024 * DISPLAY_INTERVAL)); 226 sprintf(stats, "%u KB/s ", bw / (1024 * DISPLAY_INTERVAL));
227 int len = snprintf(line, LINE_MAX, "%32s geoip %d, IP database %d\n", stats, geoip_calls, radix_nodes); 227 int len = snprintf(line, LINE_MAX, "%32s geoip %d, IP database %d\n", stats, geoip_calls, radix_nodes);
228 adjust_line(line, len, cols); 228 adjust_line(line, len, cols);
229 printf("%s", line); 229 printf("%s", line);
230 230
231 HNode *ptr = dlist; 231 HNode *ptr = dlist;
232 HNode *prev = NULL; 232 HNode *prev = NULL;
233 int row = 0;
234 while (ptr) { 233 while (ptr) {
235 HNode *next = ptr->dnext; 234 HNode *next = ptr->dnext;
236 if (--ptr->ttl > 0) { 235 if (--ptr->ttl > 0) {
@@ -242,7 +241,7 @@ static void hnode_print(unsigned bw) {
242 snprintf(bytes, 11, "%u KB/s", 241 snprintf(bytes, 11, "%u KB/s",
243 (unsigned) (ptr->bytes / (DISPLAY_INTERVAL * 1024))); 242 (unsigned) (ptr->bytes / (DISPLAY_INTERVAL * 1024)));
244 else 243 else
245 snprintf(bytes, 11, "%u B/s", (unsigned) (ptr->bytes / DISPLAY_INTERVAL)); 244 snprintf(bytes, 11, "%u B/s ", (unsigned) (ptr->bytes / DISPLAY_INTERVAL));
246 245
247 char *hostname = ptr->hostname; 246 char *hostname = ptr->hostname;
248 if (!hostname) 247 if (!hostname)