diff options
author | millert@openbsd.org <millert@openbsd.org> | 2020-05-29 21:22:02 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-05-30 10:48:06 +1000 |
commit | 5ad3c3a33ef038b55a14ebd31faeeec46073db2c (patch) | |
tree | efcd2a685e4fb55796bef896b63689b21548685f /scp.c | |
parent | 712ac1efb687a945a89db6aa3e998c1a17b38653 (diff) |
upstream: Fix error message on close(2) and add printf format
attributes. From Christos Zoulas, OK markus@
OpenBSD-Commit-ID: 41523c999a9e3561fcc7082fd38ea2e0629ee07e
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: scp.c,v 1.210 2020/05/06 20:57:38 djm Exp $ */ | 1 | /* $OpenBSD: scp.c,v 1.211 2020/05/29 21:22:02 millert Exp $ */ |
2 | /* | 2 | /* |
3 | * scp - secure remote copy. This is basically patched BSD rcp which | 3 | * scp - secure remote copy. This is basically patched BSD rcp which |
4 | * uses ssh to do the data transfer (instead of using rcmd). | 4 | * uses ssh to do the data transfer (instead of using rcmd). |
@@ -373,8 +373,11 @@ typedef struct { | |||
373 | BUF *allocbuf(BUF *, int, int); | 373 | BUF *allocbuf(BUF *, int, int); |
374 | void lostconn(int); | 374 | void lostconn(int); |
375 | int okname(char *); | 375 | int okname(char *); |
376 | void run_err(const char *,...); | 376 | void run_err(const char *,...) |
377 | int note_err(const char *,...); | 377 | __attribute__((__format__ (printf, 1, 2))) |
378 | __attribute__((__nonnull__ (1))); | ||
379 | int note_err(const char *,...) | ||
380 | __attribute__((__format__ (printf, 1, 2))); | ||
378 | void verifydir(char *); | 381 | void verifydir(char *); |
379 | 382 | ||
380 | struct passwd *pwd; | 383 | struct passwd *pwd; |
@@ -1520,7 +1523,7 @@ bad: run_err("%s: %s", np, strerror(errno)); | |||
1520 | } | 1523 | } |
1521 | } | 1524 | } |
1522 | if (close(ofd) == -1) | 1525 | if (close(ofd) == -1) |
1523 | note_err(np, "%s: close: %s", np, strerror(errno)); | 1526 | note_err("%s: close: %s", np, strerror(errno)); |
1524 | (void) response(); | 1527 | (void) response(); |
1525 | if (showprogress) | 1528 | if (showprogress) |
1526 | stop_progress_meter(); | 1529 | stop_progress_meter(); |