summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMark Lumsden <lum@cvs.openbsd.org>2021-02-24 13:58:47 +0000
committerMark Lumsden <lum@cvs.openbsd.org>2021-02-24 13:58:47 +0000
commit2a8f9a0c64105a84aade2ab4eafe43f9df9b3190 (patch)
treebb1654c511fe7e67e786a3fcabb5b2d00b2c2b36 /usr.bin
parent349b2b2cde13bb721c97d9a17961cf865179b64a (diff)
snprintf() does indeed return an int. From an email Joachim Nilsson
sent to tech@ many moons ago. Sorry for the delay.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mg/dired.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/mg/dired.c b/usr.bin/mg/dired.c
index 69c806f4ebc..90d9a638373 100644
--- a/usr.bin/mg/dired.c
+++ b/usr.bin/mg/dired.c
@@ -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 @@ d_copy(int f, int n)
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);