diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-06 10:21:54 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-06 10:49:27 +0200 |
commit | 20e58c5513f7e8c5819ffa149f90760ba37d1a9f (patch) | |
tree | 76d1f826a3fb348c2f9f17003ea184c767a91649 | |
parent | 0d48fb9a8770adc089f5e5943b4c359115909524 (diff) | |
download | serenity-20e58c5513f7e8c5819ffa149f90760ba37d1a9f.zip |
AK: Make dbgprintf() and dbgputstr() go to stderr on non-Serenity hosts
-rw-r--r-- | AK/kstdio.h | 4 | ||||
-rw-r--r-- | Libraries/LibCore/IODevice.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/AK/kstdio.h b/AK/kstdio.h index 05b06365d8..7557af14b2 100644 --- a/AK/kstdio.h +++ b/AK/kstdio.h @@ -45,6 +45,6 @@ inline int dbgputstr(const char (&array)[N]) #else # include <stdio.h> # define kprintf printf -# define dbgprintf printf -# define dbgputstr(characters, length) fwrite(characters, 1, length, stdout) +# define dbgprintf(...) fprintf(stderr, __VA_ARGS__) +# define dbgputstr(characters, length) fwrite(characters, 1, length, stderr) #endif diff --git a/Libraries/LibCore/IODevice.cpp b/Libraries/LibCore/IODevice.cpp index a727f522b2..3ee2ea0317 100644 --- a/Libraries/LibCore/IODevice.cpp +++ b/Libraries/LibCore/IODevice.cpp @@ -182,7 +182,7 @@ ByteBuffer IODevice::read_line(size_t max_size) return {}; if (m_eof) { if (m_buffered_data.size() > max_size) { - dbgprintf("IODevice::read_line: At EOF but there's more than max_size(%d) buffered\n", max_size); + dbgprintf("IODevice::read_line: At EOF but there's more than max_size(%zu) buffered\n", max_size); return {}; } auto buffer = ByteBuffer::copy(m_buffered_data.data(), m_buffered_data.size()); |