summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-02-21 07:32:56 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-02-21 07:32:56 +0000
commit1e969584d9a580f9e4a323e853604bbfe3fe0eb6 (patch)
tree72b76fab72d624cb203114c5f486f90fcf1a67b1 /lib
parent64fc253682fe6c58db87b2d3937eac037505e58d (diff)
use sizeof w/ defines; niklas@ millert@ ok.
Diffstat (limited to 'lib')
-rw-r--r--lib/libutil/readlabel.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libutil/readlabel.c b/lib/libutil/readlabel.c
index b4634dab846..b94c677c9c1 100644
--- a/lib/libutil/readlabel.c
+++ b/lib/libutil/readlabel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readlabel.c,v 1.5 2001/08/16 18:34:40 millert Exp $ */
+/* $OpenBSD: readlabel.c,v 1.6 2002/02/21 07:32:55 fgsch Exp $ */
/*
* Copyright (c) 1996, Jason Downs. All rights reserved.
@@ -74,9 +74,9 @@ char *readlabelfs(device, verbose)
rpath[strlen(rpath) - 1] = 'a' + getrawpartition();
break;
case S_IFBLK:
- if (strlen(device) > strlen(_PATH_DEV)) {
+ if (strlen(device) > sizeo(_PATH_DEV) - 1) {
snprintf(rpath, sizeof(rpath), "%sr%s", _PATH_DEV,
- &device[strlen(_PATH_DEV)]);
+ &device[sizeof(_PATH_DEV) - 1]);
/* Change partition name. */
part = rpath[strlen(rpath) - 1];