Deleted Added
full compact
ifieee80211.c (127649) ifieee80211.c (127831)
1/*
2 * Copyright 2001 The Aerospace Corporation. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 10 unchanged lines hidden (view full) ---

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
1/*
2 * Copyright 2001 The Aerospace Corporation. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 10 unchanged lines hidden (view full) ---

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sbin/ifconfig/ifieee80211.c 127649 2004-03-30 22:59:22Z sam $
27 * $FreeBSD: head/sbin/ifconfig/ifieee80211.c 127831 2004-04-04 07:28:58Z phk $
28 */
29
30/*-
31 * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
32 * All rights reserved.
33 *
34 * This code is derived from software contributed to The NetBSD Foundation
35 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,

--- 505 unchanged lines hidden (view full) ---

541 for (;;) {
542 if (*val == '\0')
543 break;
544 if (sep != NULL && strchr(sep, *val) != NULL) {
545 val++;
546 break;
547 }
548 if (hexstr) {
28 */
29
30/*-
31 * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
32 * All rights reserved.
33 *
34 * This code is derived from software contributed to The NetBSD Foundation
35 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,

--- 505 unchanged lines hidden (view full) ---

541 for (;;) {
542 if (*val == '\0')
543 break;
544 if (sep != NULL && strchr(sep, *val) != NULL) {
545 val++;
546 break;
547 }
548 if (hexstr) {
549 if (!isxdigit((u_char)val[0]) ||
550 !isxdigit((u_char)val[1])) {
549 if (!isxdigit((u_char)val[0])) {
551 warnx("bad hexadecimal digits");
552 return NULL;
553 }
550 warnx("bad hexadecimal digits");
551 return NULL;
552 }
553 if (!isxdigit((u_char)val[1])) {
554 warnx("odd count hexadecimal digits");
555 return NULL;
556 }
554 }
557 }
555 if (p > buf + len) {
558 if (p >= buf + len) {
556 if (hexstr)
557 warnx("hexadecimal digits too long");
558 else
559 if (hexstr)
560 warnx("hexadecimal digits too long");
561 else
559 warnx("strings too long");
562 warnx("string too long");
560 return NULL;
561 }
562 if (hexstr) {
563#define tohex(x) (isdigit(x) ? (x) - '0' : tolower(x) - 'a' + 10)
564 *p++ = (tohex((u_char)val[0]) << 4) |
565 tohex((u_char)val[1]);
566#undef tohex
567 val += 2;

--- 39 unchanged lines hidden ---
563 return NULL;
564 }
565 if (hexstr) {
566#define tohex(x) (isdigit(x) ? (x) - '0' : tolower(x) - 'a' + 10)
567 *p++ = (tohex((u_char)val[0]) << 4) |
568 tohex((u_char)val[1]);
569#undef tohex
570 val += 2;

--- 39 unchanged lines hidden ---