[PATCH 13/16] scp: Remove `replacearg()'
Michael Witten
mfwitten at gmail.com
Tue Dec 8 07:00:56 AWST 2015
Date: Sat, 7 Nov 2015 03:48:23 -0000
It seems that it has no purpose.
---
scp.c | 1 -
scpmisc.c | 20 --------------------
scpmisc.h | 1 -
3 files changed, 22 deletions(-)
diff --git a/scp.c b/scp.c
index 9bf22e1..599042c 100644
--- a/scp.c
+++ b/scp.c
@@ -174,7 +174,6 @@ do_local_cmd(arglist *a)
static void
arg_setup(const char *user_at_host, const char *cmd)
{
- replacearg(&args, 0, "%s", ssh_program);
addargs(&args, "%s", user_at_host);
addargs(&args, "%s", cmd);
}
diff --git a/scpmisc.c b/scpmisc.c
index 88a00ca..ce27628 100644
--- a/scpmisc.c
+++ b/scpmisc.c
@@ -155,26 +155,6 @@ addargs(arglist *args, char *fmt, ...)
}
-void
-replacearg(arglist *args, u_int which, char *fmt, ...)
-{
- va_list ap;
- char *cp;
- int r;
-
- va_start(ap, fmt);
- r = vasprintf(&cp, fmt, ap);
- va_end(ap);
- if (r == -1)
- fatal("replacearg: argument too long");
-
- if (which >= args->num)
- fatal("replacearg: tried to replace invalid arg %d >= %d",
- which, args->num);
- xfree(args->list[which]);
- args->list[which] = cp;
-}
-
void
freeargs(arglist *args)
{
u_int i;
diff --git a/scpmisc.h b/scpmisc.h
index 6978c66..2a18173 100644
--- a/scpmisc.h
+++ b/scpmisc.h
@@ -33,7 +33,6 @@ struct arglist {
int nalloc;
};
void addargs(arglist *, char *, ...);
-void replacearg(arglist *, u_int, char *, ...);
void freeargs(arglist *);
/* from xmalloc.h */
--
2.4.3
More information about the Dropbear
mailing list