Quick style polishing...

This commit is contained in:
Philippe Houdoin 2013-05-24 10:11:53 +02:00
parent de6f4cc900
commit 8683f5d4ee

View File

@ -2,16 +2,21 @@
#include <stdio.h>
#include <net/if.h>
int main(int argc, char *argv[])
int main(int argc, char* argv[])
{
struct if_nameindex *ifs;
int i;
struct if_nameindex* ifs;
int i;
ifs = if_nameindex();
if (ifs == NULL) { perror("if_nameindex"); exit(EXIT_FAILURE); }
ifs = if_nameindex();
if (ifs == NULL) {
perror("if_nameindex");
exit(EXIT_FAILURE);
}
for (i = 0; ifs[i].if_index != 0 || ifs[i].if_name != NULL; i++) {
printf("%d %s\n", ifs[i].if_index, ifs[i].if_name);
}
return EXIT_SUCCESS;
for (i = 0; ifs[i].if_index != 0 || ifs[i].if_name != NULL; i++) {
printf("%d %s\n", ifs[i].if_index, ifs[i].if_name);
}
return EXIT_SUCCESS;
}