]> git.ozlabs.org Git - ppp.git/commitdiff
pppd: Avoid declarations within statements in main.c
authorPaul Mackerras <paulus@ozlabs.org>
Sat, 19 Oct 2019 06:13:47 +0000 (17:13 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Sat, 19 Oct 2019 06:13:47 +0000 (17:13 +1100)
Since we still have old-style function declarations for now, avoid
putting declarations within statements, which old compilers didn't
accept.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
pppd/main.c

index 9e9803a2c81fdce2e44f781cc98f354b557df08d..652240cc6868bf13b4404be886beff2231263cd0 100644 (file)
@@ -737,13 +737,14 @@ void
 set_ifunit(iskey)
     int iskey;
 {
 set_ifunit(iskey)
     int iskey;
 {
+    char ifkey[32];
+
     if (req_ifname[0] != '\0')
        slprintf(ifname, sizeof(ifname), "%s", req_ifname);
     else
        slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
     info("Using interface %s", ifname);
     script_setenv("IFNAME", ifname, iskey);
     if (req_ifname[0] != '\0')
        slprintf(ifname, sizeof(ifname), "%s", req_ifname);
     else
        slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
     info("Using interface %s", ifname);
     script_setenv("IFNAME", ifname, iskey);
-    char ifkey[32];
     slprintf(ifkey, sizeof(ifkey), "%d", ifunit);
     script_setenv("UNIT", ifkey, iskey);
     if (iskey) {
     slprintf(ifkey, sizeof(ifkey), "%d", ifunit);
     script_setenv("UNIT", ifkey, iskey);
     if (iskey) {