diff options
author | djm@openbsd.org <djm@openbsd.org> | 2022-05-25 02:31:13 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2022-05-25 02:33:16 +0200 |
commit | 9e0d02ef7ce88b67643bfb1c2272c9f5f04cc680 (patch) | |
tree | 1714adbffadc64c2b0a8bbc2590cc6b81d14fdc9 /sshbuf.h | |
parent | configure.ac: Add missing AC_DEFINE for caph_cache_tzdata test causing (diff) | |
download | openssh-9e0d02ef7ce88b67643bfb1c2272c9f5f04cc680.tar.xz openssh-9e0d02ef7ce88b67643bfb1c2272c9f5f04cc680.zip |
upstream: make SSHBUF_DBG/SSHBUF_TELL (off by default and only enabled
via #define) dump to stderr rather than stdout
OpenBSD-Commit-ID: 10298513ee32db8390aecb0397d782d68cb14318
Diffstat (limited to 'sshbuf.h')
-rw-r--r-- | sshbuf.h | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: sshbuf.h,v 1.25 2022/01/22 00:43:43 djm Exp $ */ +/* $OpenBSD: sshbuf.h,v 1.26 2022/05/25 00:31:13 djm Exp $ */ /* * Copyright (c) 2011 Damien Miller * @@ -395,16 +395,17 @@ u_int sshbuf_refcount(const struct sshbuf *buf); # ifdef SSHBUF_DEBUG # define SSHBUF_TELL(what) do { \ - printf("%s:%d %s: %s size %zu alloc %zu off %zu max %zu\n", \ + fprintf(stderr, \ + "%s:%d %s: %s size %zu alloc %zu off %zu max %zu\n", \ __FILE__, __LINE__, __func__, what, \ buf->size, buf->alloc, buf->off, buf->max_size); \ - fflush(stdout); \ + fflush(stderr); \ } while (0) -# define SSHBUF_DBG(x) do { \ - printf("%s:%d %s: ", __FILE__, __LINE__, __func__); \ - printf x; \ - printf("\n"); \ - fflush(stdout); \ +# define SSHBUF_DBG(...) do { \ + fprintf(stderr, "%s:%d %s: ", __FILE__, __LINE__, __func__); \ + fprintf(stderr, __VA_ARGS__); \ + fprintf(stderr, "\n"); \ + fflush(stderr); \ } while (0) # else # define SSHBUF_TELL(what) |