[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Two improvements for dired.c
- To: tech_(_at_)_openbsd_(_dot_)_org
- Subject: Two improvements for dired.c
- From: Han Boetes <han_(_at_)_mijncomputer_(_dot_)_nl>
- Date: Sat, 7 May 2005 17:42:17 +0200
- Mail-followup-to: tech_(_at_)_openbsd_(_dot_)_org
Hi,
- strlcpy returns size_t, and not int.
- Correct english errormessages.
Index: dired.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/dired.c,v
retrieving revision 1.17
diff -u -p -r1.17 dired.c
--- dired.c 28 Apr 2005 07:14:09 -0000 1.17
+++ dired.c 7 May 2005 15:36:07 -0000
@@ -295,7 +295,7 @@ d_copy(int f, int n)
{
char frname[NFILEN], toname[NFILEN], *bufp;
int stat;
- int off;
+ size_t off;
BUFFER *bp;
if (d_makename(curwp->w_dotp, frname, sizeof(frname)) != FALSE) {
@@ -304,7 +304,7 @@ d_copy(int f, int n)
}
off = strlcpy(toname, curbp->b_fname, sizeof(toname));
if (off >= sizeof(toname) - 1) { /* can't happen, really */
- ewprintf("too long directory name");
+ ewprintf("Directory name too long");
return (FALSE);
}
if ((bufp = eread("Copy %s to: ", toname + off, sizeof(toname) - off,
@@ -324,7 +324,8 @@ int
d_rename(int f, int n)
{
char frname[NFILEN], toname[NFILEN], *bufp;
- int stat, off;
+ int stat;
+ size_t off;
BUFFER *bp;
if (d_makename(curwp->w_dotp, frname, sizeof(frname)) != FALSE) {
@@ -333,7 +334,7 @@ d_rename(int f, int n)
}
off = strlcpy(toname, curbp->b_fname, sizeof(toname));
if (off >= sizeof(toname) - 1) { /* can't happen, really */
- ewprintf("too long directory name");
+ ewprintf("Directory name too long");
return (FALSE);
}
if ((bufp = eread("Rename %s to: ", toname + off,
@@ -453,7 +454,7 @@ int
d_create_directory(int f, int n)
{
char tocreate[MAXPATHLEN], *bufp;
- ssize_t off;
+ size_t off;
BUFFER *bp;
off = strlcpy(tocreate, curbp->b_fname, sizeof(tocreate));
# Han
Visit your host, monkey.org