diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-05-08 20:27:25 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-05-08 20:27:25 +0000 |
commit | 387c472660ef173c2e469e70eb1a25d47f6e8887 (patch) | |
tree | 4686516a373bbb5ca9594c4cb285aedc6a72aa8d /misc.c | |
parent | 69128668938c82e8d428e77726ef00b2b6f799b9 (diff) | |
download | openssh-git-387c472660ef173c2e469e70eb1a25d47f6e8887.tar.gz |
- mouring@cvs.openbsd.org 2001/05/08 19:45:25
[misc.c misc.h scp.c sftp.c]
Use addargs() in sftp plus some clean up of addargs(). OK Markus
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.6 2001/05/03 23:09:52 mouring Exp $ */ +/* $OpenBSD: misc.c,v 1.7 2001/05/08 19:45:24 mouring Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -25,7 +25,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: misc.c,v 1.6 2001/05/03 23:09:52 mouring Exp $"); +RCSID("$OpenBSD: misc.c,v 1.7 2001/05/08 19:45:24 mouring Exp $"); #include "misc.h" #include "log.h" @@ -164,6 +164,27 @@ colon(char *cp) return (0); } +void +addargs(arglist *args, char *fmt, ...) +{ + va_list ap; + char buf[1024]; + + va_start(ap, fmt); + vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + + if (args->list == NULL) { + args->nalloc = 32; + args->num = 0; + } else if (args->num+2 >= args->nalloc) + args->nalloc *= 2; + + args->list = xrealloc(args->list, args->nalloc * sizeof(char *)); + args->list[args->num++] = xstrdup(buf); + args->list[args->num] = NULL; +} + mysig_t mysignal(int sig, mysig_t act) { |