diff options
author | dlg <dlg@openbsd.org> | 2014-11-19 11:48:39 +0000 |
---|---|---|
committer | dlg <dlg@openbsd.org> | 2014-11-19 11:48:39 +0000 |
commit | 0d71831bb1e345d849e0e5be55d1889dbfe25041 (patch) | |
tree | e0f1b5e6179c9bea028ac04b0ba77dee0b519337 /usr.sbin/tftpd | |
parent | include camellia.h using the public include path (diff) | |
download | wireguard-openbsd-0d71831bb1e345d849e0e5be55d1889dbfe25041.tar.xz wireguard-openbsd-0d71831bb1e345d849e0e5be55d1889dbfe25041.zip |
move to stravis so doug@ will stop laughing at my misuse of strnvis.
ok doug@ millert@
Diffstat (limited to 'usr.sbin/tftpd')
-rw-r--r-- | usr.sbin/tftpd/tftpd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/tftpd/tftpd.c b/usr.sbin/tftpd/tftpd.c index b3497ae22c7..64282c0a6da 100644 --- a/usr.sbin/tftpd/tftpd.c +++ b/usr.sbin/tftpd/tftpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tftpd.c,v 1.22 2014/08/13 17:41:58 tobias Exp $ */ +/* $OpenBSD: tftpd.c,v 1.23 2014/11/19 11:48:39 dlg Exp $ */ /* * Copyright (c) 2012 David Gwynne <dlg@uq.edu.au> @@ -434,14 +434,17 @@ rewrite_events(void) void rewrite_map(struct tftp_client *client, const char *filename) { - char nicebuf[MAXPATHLEN]; + char *nicebuf; - (void)strnvis(nicebuf, filename, MAXPATHLEN, VIS_SAFE|VIS_OCTAL); + if (stravis(&nicebuf, filename, VIS_SAFE|VIS_OCTAL) == -1) + lerr(1, "rwmap stravis"); if (evbuffer_add_printf(rwmap->wrbuf, "%s %s %s\n", getip(&client->ss), client->opcode == WRQ ? "write" : "read", nicebuf) == -1) lerr(1, "rwmap printf"); + free(nicebuf); + TAILQ_INSERT_TAIL(&rwmap->clients, client, entry); event_add(&rwmap->wrev, NULL); |