summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/rcsutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/rcs/rcsutil.c')
-rw-r--r--usr.bin/rcs/rcsutil.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/rcs/rcsutil.c b/usr.bin/rcs/rcsutil.c
index 05bcb5413b7..403b5abad55 100644
--- a/usr.bin/rcs/rcsutil.c
+++ b/usr.bin/rcs/rcsutil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsutil.c,v 1.21 2006/09/25 23:58:05 ray Exp $ */
+/* $OpenBSD: rcsutil.c,v 1.22 2006/10/12 17:20:12 niallo Exp $ */
/*
* Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -196,9 +196,9 @@ rcs_choosefile(const char *filename, char *out, size_t len)
* This ensures that there is at least one suffix for strsep().
*/
if (strcmp(rcs_suffixes, "") == 0) {
- fd = open(rcspath, O_RDONLY);
if (strlcpy(out, rcspath, len) >= len)
errx(1, "rcs_choosefile: truncation");
+ fd = open(rcspath, O_RDONLY);
return (fd);
}
@@ -259,10 +259,11 @@ rcs_choosefile(const char *filename, char *out, size_t len)
xfree(suffixes);
- fd = open(rcspath, O_RDONLY);
if (strlcpy(out, rcspath, len) >= len)
errx(1, "rcs_choosefile: truncation");
+ fd = open(rcspath, O_RDONLY);
+
return (fd);
}