From c226a1a5746a6ef88d5315d2c1060b2004d48c7d Mon Sep 17 00:00:00 2001 From: Kjell Wooding Date: Tue, 20 Dec 2005 05:04:29 +0000 Subject: Do some delinting of strl-type functions. Also, remove a superfluous word in the undo-list. --- usr.bin/mg/fileio.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'usr.bin/mg/fileio.c') 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. */ -- cgit v1.2.3