summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/sftp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2004-11-29 07:41:25 +0000
committerDamien Miller <djm@cvs.openbsd.org>2004-11-29 07:41:25 +0000
commit0e91e5b94fb68ab00eed960bad30f73eba33c15b (patch)
tree3479f6fc7af36e240fd6fc3aa13acdc66bfdf89b /usr.bin/ssh/sftp.c
parenta1af43e11e4ea7a2184567b2986bb89cb5ffc37c (diff)
Some small fixes from moritz@jodeit.org. ok deraadt@
Diffstat (limited to 'usr.bin/ssh/sftp.c')
-rw-r--r--usr.bin/ssh/sftp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c
index 70b8963f767..da2bb921e9b 100644
--- a/usr.bin/ssh/sftp.c
+++ b/usr.bin/ssh/sftp.c
@@ -16,7 +16,7 @@
#include "includes.h"
-RCSID("$OpenBSD: sftp.c,v 1.58 2004/11/25 22:22:14 markus Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.59 2004/11/29 07:41:24 djm Exp $");
#include <glob.h>
#include <histedit.h>
@@ -155,9 +155,11 @@ static void
cmd_interrupt(int signo)
{
const char msg[] = "\rInterrupt \n";
+ int olderrno = errno;
write(STDERR_FILENO, msg, sizeof(msg) - 1);
interrupted = 1;
+ errno = olderrno;
}
static void
@@ -257,7 +259,7 @@ path_strip(char *path, char *strip)
return (xstrdup(path));
len = strlen(strip);
- if (strip != NULL && strncmp(path, strip, len) == 0) {
+ if (strncmp(path, strip, len) == 0) {
if (strip[len - 1] != '/' && path[len] == '/')
len++;
return (xstrdup(path + len));