[riot-notifications] [RIOT-OS/RIOT] shell_commands: fix regression to ifconfig introduced in #10350 (#11746)

Gaƫtan Harter notifications at github.com
Wed Jun 26 14:04:57 CEST 2019


cladmi approved this pull request.

ACK, tested with `samr21-xpro` and `scan-build-analyze`.

Now the diff from before the breaking commit is only removing setting `line_threshold` for nothing (as `scan-build` was complaining).

```diff
git diff 2cb0ccc800c176bb7d2a1a77606f7c5fd06fb788^ sys/shell/commands/sc_gnrc_netif.c
diff --git a/sys/shell/commands/sc_gnrc_netif.c b/sys/shell/commands/sc_gnrc_netif.c
index d9777589f..b6404c656 100644
--- a/sys/shell/commands/sc_gnrc_netif.c
+++ b/sys/shell/commands/sc_gnrc_netif.c
@@ -348,7 +348,6 @@ static unsigned _netif_list_flag(kernel_pid_t iface, netopt_t opt, char *str,
 static void _netif_list_ipv6(ipv6_addr_t *addr, uint8_t flags)
 {
     char addr_str[IPV6_ADDR_MAX_STR_LEN];
-    unsigned line_thresh = _LINE_THRESHOLD;
 
     printf("inet6 addr: ");
     ipv6_addr_to_str(addr_str, addr, sizeof(addr_str));
@@ -379,19 +378,17 @@ static void _netif_list_ipv6(ipv6_addr_t *addr, uint8_t flags)
                 break;
         }
     }
-    line_thresh = _newline(0U, line_thresh);
+    _newline(0U, _LINE_THRESHOLD);
 }
 
 static void _netif_list_groups(ipv6_addr_t *addr)
 {
-    unsigned line_thresh = _LINE_THRESHOLD;
-
     if ((ipv6_addr_is_multicast(addr))) {
         char addr_str[IPV6_ADDR_MAX_STR_LEN];
         ipv6_addr_to_str(addr_str, addr, sizeof(addr_str));
         printf("inet6 group: %s", addr_str);
     }
-    line_thresh = _newline(0U, line_thresh);
+    _newline(0U, _LINE_THRESHOLD);
 }
 #endif
 
@@ -547,7 +544,7 @@ static void _netif_list(kernel_pid_t iface)
     printf("Link type: %s",
            (gnrc_netapi_get(iface, NETOPT_IS_WIRED, 0, &u16, sizeof(u16)) > 0) ?
             "wired" : "wireless");
-    line_thresh = _newline(0U, ++line_thresh);
+    _newline(0U, ++line_thresh);
     res = gnrc_netapi_get(iface, NETOPT_IPV6_ADDR, 0, ipv6_addrs,
                           sizeof(ipv6_addrs));
     if (res >= 0) {
```



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11746#pullrequestreview-254564693
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190626/731dee89/attachment-0001.html>


More information about the notifications mailing list