From 33fd55ca6f3efc50c260469179788e9f725ddc58 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 21 Aug 2020 11:28:08 +0200 Subject: common: Strip trailing CR,LF from w32_strerror. * common/stringhelp.c (w32_strerror): Strip trailing CR,LF. * common/iobuf.c (iobuf_get_filelength): Use -1 and not 0 for the arg to w32_strerror. -- This is in particular annoying since we started to use a string argument sanitizer in the logging code. Before that we just add an extra blank line. The second patch corrects a never yet seen error message. Signed-off-by: Werner Koch --- common/iobuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/iobuf.c') diff --git a/common/iobuf.c b/common/iobuf.c index f9c788a7b..a5b8d5955 100644 --- a/common/iobuf.c +++ b/common/iobuf.c @@ -2420,7 +2420,7 @@ iobuf_get_filelength (iobuf_t a, int *overflow) return size; } log_error ("GetFileSize for handle %p failed: %s\n", - fp, w32_strerror (0)); + fp, w32_strerror (-1)); #else /*!HAVE_W32_SYSTEM*/ { struct stat st; -- cgit v1.2.3