diff options
author | Klaas Freitag <freitag@suse.de> | 1998-11-15 20:07:31 +0000 |
---|---|---|
committer | Klaas Freitag <freitag@suse.de> | 1998-11-15 20:07:31 +0000 |
commit | 49d6a0009c6ab09ed184028a082a098d455a34f2 (patch) | |
tree | f3e03429bb25dd641148c70cd8af596732c162f0 /lib/loopback.c | |
parent | - Use numerical sort for interface sorting. (diff) | |
download | net-tools-49d6a0009c6ab09ed184028a082a098d455a34f2.tar.gz net-tools-49d6a0009c6ab09ed184028a082a098d455a34f2.tar.bz2 net-tools-49d6a0009c6ab09ed184028a082a098d455a34f2.zip |
Yow. This is net-tools completely reindented.
Some other cleanups:
- lib/net-string.c removed because it was not used and had a copyright notice
that conflicted with the GPL.
- Minor cleanups.
- Fix an potential buffer overflow in ax25.
- Switch to CVS $Id$ for versioning consistently
Diffstat (limited to 'lib/loopback.c')
-rw-r--r-- | lib/loopback.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/lib/loopback.c b/lib/loopback.c index 8c9f4c1..a96fd81 100644 --- a/lib/loopback.c +++ b/lib/loopback.c @@ -1,19 +1,19 @@ /* - * lib/loopback.c This file contains the general hardware types. + * lib/loopback.c This file contains the general hardware types. * - * Version: @(#)loopback.c 1.10 10/07/93 + * Version: $Id: loopback.c,v 1.3 1998/11/15 20:11:06 freitag Exp $ * - * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> - * Copyright 1993 MicroWalt Corporation + * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> + * Copyright 1993 MicroWalt Corporation * * Modifications: * 1998-07-01 - Arnaldo Carvalho de Melo - GNU gettext instead of catgets * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General - * Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at - * your option) any later version. + * This program is free software; you can redistribute it + * and/or modify it under the terms of the GNU General + * Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at + * your option) any later version. */ #include "config.h" @@ -31,40 +31,40 @@ #include "intl.h" /* Display an UNSPEC address. */ -static char * -pr_unspec(unsigned char *ptr) +static char *pr_unspec(unsigned char *ptr) { - static char buff[64]; - char *pos; - unsigned int i; + static char buff[64]; + char *pos; + unsigned int i; - pos = buff; - for(i = 0; i < sizeof(struct sockaddr); i++) { + pos = buff; + for (i = 0; i < sizeof(struct sockaddr); i++) { pos += sprintf(pos, "%02X-", (*ptr++ & 0377)); - } - buff[strlen(buff) - 1] = '\0'; - return(buff); + } + buff[strlen(buff) - 1] = '\0'; + return (buff); } /* Display an UNSPEC socket address. */ -static char * -pr_sunspec(struct sockaddr *sap) +static char *pr_sunspec(struct sockaddr *sap) { - static char buf[64]; + static char buf[64]; - if (sap->sa_family == 0xFFFF || sap->sa_family == 0) - return strncpy (buf, _("[NONE SET]"), sizeof (buf)); - return(pr_unspec(sap->sa_data)); + if (sap->sa_family == 0xFFFF || sap->sa_family == 0) + return strncpy(buf, _("[NONE SET]"), sizeof(buf)); + return (pr_unspec(sap->sa_data)); } -struct hwtype unspec_hwtype = { - "unspec", NULL, /*"UNSPEC",*/ -1, 0, - pr_unspec, pr_sunspec, NULL, NULL +struct hwtype unspec_hwtype = +{ + "unspec", NULL, /*"UNSPEC", */ -1, 0, + pr_unspec, pr_sunspec, NULL, NULL }; -struct hwtype loop_hwtype = { - "loop", NULL, /*"Local Loopback",*/ 255/*ARPHRD_LOOPBACK*/, 0, - NULL, NULL, NULL, NULL +struct hwtype loop_hwtype = +{ + "loop", NULL, /*"Local Loopback", */ 255 /*ARPHRD_LOOPBACK */ , 0, + NULL, NULL, NULL, NULL }; |