1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

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 <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-08-21 11:28:08 +02:00
parent ba873216ff
commit 33fd55ca6f
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
2 changed files with 7 additions and 1 deletions

View file

@ -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;