summaryrefslogtreecommitdiff
path: root/usr.bin/mg/fileio.c
diff options
context:
space:
mode:
authorKjell Wooding <kjell@cvs.openbsd.org>2005-12-20 05:04:29 +0000
committerKjell Wooding <kjell@cvs.openbsd.org>2005-12-20 05:04:29 +0000
commitc226a1a5746a6ef88d5315d2c1060b2004d48c7d (patch)
treefad9060e84b9806d614abb0ca368a09393900e26 /usr.bin/mg/fileio.c
parentbfe486f003f4f00794a1eaa74f748459b856f2b2 (diff)
Do some delinting of strl-type functions. Also, remove a superfluous
word in the undo-list.
Diffstat (limited to 'usr.bin/mg/fileio.c')
-rw-r--r--usr.bin/mg/fileio.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/mg/fileio.c b/usr.bin/mg/fileio.c
index 75ee6363608..9cc81311d42 100644
--- a/usr.bin/mg/fileio.c
+++ b/usr.bin/mg/fileio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fileio.c,v 1.66 2005/12/13 05:40:33 kjell Exp $ */
+/* $OpenBSD: fileio.c,v 1.67 2005/12/20 05:04:28 kjell Exp $ */
/* This file is in the public domain. */
@@ -454,12 +454,13 @@ make_file_list(char *buf)
return (NULL);
}
/* Now we get the prefix of the name the user typed. */
- strlcpy(prefixx, buf, sizeof(prefixx));
+ if (strlcpy(prefixx, buf, sizeof(prefixx)) >= sizeof(prefixx))
+ return (NULL);
cp = strrchr(prefixx, '/');
if (cp == NULL)
- prefixx[0] = 0;
+ prefixx[0] = '\0';
else
- cp[1] = 0;
+ cp[1] = '\0';
preflen = strlen(prefixx);
/* cp is the tail of buf that really needs to be compared. */