diff options
author | 2002-01-23 22:04:01 +0000 | |
---|---|---|
committer | 2002-01-23 22:04:01 +0000 | |
commit | 9b0cec34f56f90b276fddd6a617deb9e6cde4e47 (patch) | |
tree | 8d216fb05a0f5b77a1159653556bec8bc6c723f9 | |
parent | recognize athlon model 6 and model 7; from netbsd (diff) | |
download | wireguard-openbsd-9b0cec34f56f90b276fddd6a617deb9e6cde4e47.tar.xz wireguard-openbsd-9b0cec34f56f90b276fddd6a617deb9e6cde4e47.zip |
use sizeof instead of magic numbers
-rw-r--r-- | sbin/fdisk/misc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/fdisk/misc.c b/sbin/fdisk/misc.c index 997b271c177..e511cf36a8c 100644 --- a/sbin/fdisk/misc.c +++ b/sbin/fdisk/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.8 2002/01/18 08:38:26 kjell Exp $ */ +/* $OpenBSD: misc.c,v 1.9 2002/01/23 22:04:01 mickey Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -76,9 +76,9 @@ ask_cmd(cmd) buf = &buf[strspn(buf, " \t")]; cp = &buf[strcspn(buf, " \t")]; *cp++ = '\0'; - strncpy(cmd->cmd, buf, 10); + strncpy(cmd->cmd, buf, sizeof(cmd->cmd)); buf = &cp[strspn(cp, " \t")]; - strncpy(cmd->args, buf, 100); + strncpy(cmd->args, buf, sizeof(cmd->args)); return (0); } |