summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
Diffstat (limited to 'regress')
-rw-r--r--regress/misc/kexfuzz/kexfuzz.c4
-rw-r--r--regress/netcat.c40
2 files changed, 3 insertions, 41 deletions
diff --git a/regress/misc/kexfuzz/kexfuzz.c b/regress/misc/kexfuzz/kexfuzz.c
index e6751d31c..2894d3a1e 100644
--- a/regress/misc/kexfuzz/kexfuzz.c
+++ b/regress/misc/kexfuzz/kexfuzz.c
@@ -17,7 +17,9 @@
17#include <string.h> 17#include <string.h>
18#include <unistd.h> 18#include <unistd.h>
19#include <fcntl.h> 19#include <fcntl.h>
20#include <err.h> 20#ifdef HAVE_ERR_H
21# include <err.h>
22#endif
21 23
22#include "ssherr.h" 24#include "ssherr.h"
23#include "ssh_api.h" 25#include "ssh_api.h"
diff --git a/regress/netcat.c b/regress/netcat.c
index 6234ba019..7c29e0cf9 100644
--- a/regress/netcat.c
+++ b/regress/netcat.c
@@ -134,46 +134,6 @@ void usage(int);
134ssize_t drainbuf(int, unsigned char *, size_t *); 134ssize_t drainbuf(int, unsigned char *, size_t *);
135ssize_t fillbuf(int, unsigned char *, size_t *); 135ssize_t fillbuf(int, unsigned char *, size_t *);
136 136
137static void err(int, const char *, ...) __attribute__((format(printf, 2, 3)));
138static void errx(int, const char *, ...) __attribute__((format(printf, 2, 3)));
139static void warn(const char *, ...) __attribute__((format(printf, 1, 2)));
140
141static void
142err(int r, const char *fmt, ...)
143{
144 va_list args;
145
146 va_start(args, fmt);
147 fprintf(stderr, "%s: ", strerror(errno));
148 vfprintf(stderr, fmt, args);
149 fputc('\n', stderr);
150 va_end(args);
151 exit(r);
152}
153
154static void
155errx(int r, const char *fmt, ...)
156{
157 va_list args;
158
159 va_start(args, fmt);
160 vfprintf(stderr, fmt, args);
161 fputc('\n', stderr);
162 va_end(args);
163 exit(r);
164}
165
166static void
167warn(const char *fmt, ...)
168{
169 va_list args;
170
171 va_start(args, fmt);
172 fprintf(stderr, "%s: ", strerror(errno));
173 vfprintf(stderr, fmt, args);
174 fputc('\n', stderr);
175 va_end(args);
176}
177 137
178int 138int
179main(int argc, char *argv[]) 139main(int argc, char *argv[])