From 66b4399881d8bdd22b71e1c3c4b5e326d21eca4b Mon Sep 17 00:00:00 2001 From: tg Date: Sat, 1 Aug 2009 20:31:47 +0000 Subject: [PATCH] use sizeof --- misc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc.c b/misc.c index 987ca29..b528257 100644 --- a/misc.c +++ b/misc.c @@ -29,7 +29,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.113 2009/08/01 20:29:24 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.114 2009/08/01 20:31:47 tg Exp $"); #undef USE_CHVT /* XXX conditions correct? */ @@ -1365,9 +1365,9 @@ chvt(const char *fn) } else { if (stat(fn, &sb)) { memcpy(dv, "/dev/ttyC", 9); - strlcpy(dv + 9, fn, 20 - 9); + strlcpy(dv + 9, fn, sizeof(dv) - 9); if (stat(dv, &sb)) { - strlcpy(dv + 8, fn, 20 - 8); + strlcpy(dv + 8, fn, sizeof(dv) - 8); if (stat(dv, &sb)) errorf("chvt: can't find tty %s", fn); }