X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Fifconfig_src%2Fmain.c;h=1047ca34f7782bc03c061a458bb5a35dec5da721;hb=368c14e71abbef4d1a5863330312b80bfeb2ea7c;hp=2fe0f24f485584cf7ee2c9cbccdf1f476653c436;hpb=b7d27cb988daadd457370e7e1a19aaec342e8415;p=tpg%2Facess2.git diff --git a/Usermode/Applications/ifconfig_src/main.c b/Usermode/Applications/ifconfig_src/main.c index 2fe0f24f..1047ca34 100644 --- a/Usermode/Applications/ifconfig_src/main.c +++ b/Usermode/Applications/ifconfig_src/main.c @@ -56,7 +56,7 @@ void DumpInterfaces(int DumpAll) { int dp, fd; int type; - char path[sizeof(IPSTACK_ROOT)+1+FILENAME_MAX] = IPSTACK_ROOT"/"; + char path[sizeof(IPSTACK_ROOT)+1+FILENAME_MAX+1] = IPSTACK_ROOT"/"; char *filename = &path[sizeof(IPSTACK_ROOT)]; dp = open(IPSTACK_ROOT, OPENFLAG_READ); @@ -67,16 +67,18 @@ void DumpInterfaces(int DumpAll) fd = open(path, OPENFLAG_READ); if(fd == -1) { - printf("%s:\tUnable to open ('%s'\n\n", filename, path); + printf("%s:\tUnable to open ('%s')\n", filename, path); + continue ; } type = ioctl(fd, 4, NULL); printf("%s:\t", filename); { - int len = ioctl(fd, ioctl(fd, 3, "get_device"), NULL); + int call = ioctl(fd, 3, "get_device"); + int len = ioctl(fd, call, NULL); char *buf = malloc(len+1); - ioctl(fd, ioctl(fd, 3, "get_device"), buf); + ioctl(fd, call, buf); printf("'%s'\t", buf); free(buf); }