summaryrefslogtreecommitdiffstats
path: root/usr.sbin/wicontrol/wicontrol.c
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1999-05-06 03:34:02 +0000
committerwpaul <wpaul@FreeBSD.org>1999-05-06 03:34:02 +0000
commit7d2d27f237c5ac452d99e307807552cabebee0d1 (patch)
tree149896fbee007e30763a106f82b4e3622a7a85e4 /usr.sbin/wicontrol/wicontrol.c
parent78c2183cb646fef06657bbcf5849e433600ce2e3 (diff)
downloadFreeBSD-src-7d2d27f237c5ac452d99e307807552cabebee0d1.zip
FreeBSD-src-7d2d27f237c5ac452d99e307807552cabebee0d1.tar.gz
Fix some byte ordering problems; I was storing string lengths wrong,
which was causing wicontrol to crash when reading string parameters from the WaveLAN. Patches submitted by: Brad Karp <karp@eecs.harvard.edu>
Diffstat (limited to 'usr.sbin/wicontrol/wicontrol.c')
-rw-r--r--usr.sbin/wicontrol/wicontrol.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/wicontrol/wicontrol.c b/usr.sbin/wicontrol/wicontrol.c
index 3c0f490..87cd90e 100644
--- a/usr.sbin/wicontrol/wicontrol.c
+++ b/usr.sbin/wicontrol/wicontrol.c
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: wicontrol.c,v 1.14 1999/05/05 01:33:16 wpaul Exp $
+ * $Id: wicontrol.c,v 1.15 1999/05/06 03:05:48 wpaul Exp $
*/
#include <sys/types.h>
@@ -56,7 +56,7 @@
static const char copyright[] = "@(#) Copyright (c) 1997, 1998, 1999\
Bill Paul. All rights reserved.";
static const char rcsid[] =
- "@(#) $Id: wicontrol.c,v 1.14 1999/05/05 01:33:16 wpaul Exp $";
+ "@(#) $Id: wicontrol.c,v 1.15 1999/05/06 03:05:48 wpaul Exp $";
#endif
static void wi_getval __P((char *, struct wi_req *));
@@ -136,7 +136,7 @@ void wi_printstr(wreq)
}
} else {
ptr = (char *)&wreq->wi_val[1];
- for (i = 0; i < ntohs(wreq->wi_val[0]); i++) {
+ for (i = 0; i < wreq->wi_val[0]; i++) {
if (ptr[i] == '\0')
ptr[i] = ' ';
}
@@ -168,7 +168,7 @@ void wi_setstr(iface, code, str)
wreq.wi_type = code;
wreq.wi_len = 18;
- wreq.wi_val[0] = htons(strlen(str));
+ wreq.wi_val[0] = strlen(str);
bcopy(str, (char *)&wreq.wi_val[1], strlen(str));
wi_setval(iface, &wreq);
OpenPOWER on IntegriCloud