summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-01-23 22:04:02 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-01-23 22:04:02 +0000
commit3298e52ddeec078404e479a1259f5eca6ca03f09 (patch)
treeaa83c9cb44164e04da05b0dde519637bd9b4d932 /sbin
parent1c03e60ab6cfdf576b26139d90047c232213a415 (diff)
use sizeof instead of magic numbers
Diffstat (limited to 'sbin')
-rw-r--r--sbin/fdisk/misc.c6
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);
}