=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mg/dired.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- src/usr.bin/mg/dired.c 2019/07/11 18:20:18 1.93 +++ src/usr.bin/mg/dired.c 2021/02/24 13:58:46 1.94 @@ -1,4 +1,4 @@ -/* $OpenBSD: dired.c,v 1.93 2019/07/11 18:20:18 lum Exp $ */ +/* $OpenBSD: dired.c,v 1.94 2021/02/24 13:58:46 lum Exp $ */ /* This file is in the public domain. */ @@ -479,9 +479,9 @@ topath = adjustname(toname, TRUE); if (stat(topath, &statbuf) == 0) { if (S_ISDIR(statbuf.st_mode)) { - off = snprintf(toname, sizeof(toname), "%s/%s", + ret = snprintf(toname, sizeof(toname), "%s/%s", topath, sname); - if (off < 0 || off >= sizeof(toname) - 1) { + if (ret < 0 || ret >= sizeof(toname) - 1) { dobeep(); ewprintf("Directory name too long"); return (FALSE);