X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=cmds.c;h=3af02a354c25f39f893b21b5d9b568a0154a77f5;hb=00bc8103dc2171defe1f3d05d9c94bf57a84d41c;hp=64e4c1a9eb86670d94a9db9cf60b3d5c1ea36f55;hpb=a56ea10ad9fab6db773d05852e0f313d24ae89fd;p=betaftpd diff --git a/cmds.c b/cmds.c index 64e4c1a..3af02a3 100644 --- a/cmds.c +++ b/cmds.c @@ -1745,9 +1745,9 @@ int do_openfile(struct conn * const c, char * const path, #if WANT_UPLOAD if ((flags & O_CREAT) == 0) { #endif - stat(ptr, &buf); + TRAP_ERROR(stat(ptr, &buf) == -1, 550, return -2); if (!S_ISREG(buf.st_mode)) { - numeric(c, 550, "%s: Not a plain file.", ptr); + numeric(c, 550, "Not a plain file.", ptr); return -2; } #if WANT_UPLOAD