diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2008-07-23 09:15:38 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2008-07-23 09:15:38 +0000 |
commit | 24cf82b14a50efe0bb150e7651f451a3cc36103b (patch) | |
tree | 31274ced9514914f9504202c6e49c93d509e710d /sftp.c | |
parent | 024ab8dd1d8c50215dd4a503416b095663d4346c (diff) | |
download | src-test2-24cf82b14a50efe0bb150e7651f451a3cc36103b.tar.gz src-test2-24cf82b14a50efe0bb150e7651f451a3cc36103b.zip |
Notes
Diffstat (limited to 'sftp.c')
-rw-r--r-- | sftp.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: sftp.c,v 1.93 2006/09/30 17:48:22 ray Exp $ */ +/* $OpenBSD: sftp.c,v 1.96 2007/01/03 04:09:15 stevesk Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> * @@ -166,6 +166,7 @@ static const struct CMD cmds[] = { int interactive_loop(int fd_in, int fd_out, char *file1, char *file2); +/* ARGSUSED */ static void killchild(int signo) { @@ -177,6 +178,7 @@ killchild(int signo) _exit(1); } +/* ARGSUSED */ static void cmd_interrupt(int signo) { @@ -298,11 +300,11 @@ static char * path_append(char *p1, char *p2) { char *ret; - int len = strlen(p1) + strlen(p2) + 2; + size_t len = strlen(p1) + strlen(p2) + 2; ret = xmalloc(len); strlcpy(ret, p1, len); - if (p1[strlen(p1) - 1] != '/') + if (p1[0] != '\0' && p1[strlen(p1) - 1] != '/') strlcat(ret, "/", len); strlcat(ret, p2, len); @@ -1566,7 +1568,7 @@ main(int argc, char **argv) fprintf(stderr, "Missing username\n"); usage(); } - addargs(&args, "-l%s",userhost); + addargs(&args, "-l%s", userhost); } if ((cp = colon(host)) != NULL) { |