Message ID | 20201013010310.497-2-luoyonggang@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Fixes gcrypt testing on msys2/mingw | expand |
On 10/13/20 3:03 AM, Yonggang Luo wrote: > On windows, if open file with "w", it's will automatically convert > "\n" to "\r\n" when writing to file. > > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> > --- > tests/crypto-tls-psk-helpers.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/crypto-tls-psk-helpers.c b/tests/crypto-tls-psk-helpers.c > index a8395477c3..11ae26368c 100644 > --- a/tests/crypto-tls-psk-helpers.c > +++ b/tests/crypto-tls-psk-helpers.c > @@ -32,7 +32,7 @@ void test_tls_psk_init(const char *pskfile) > { > FILE *fp; > > - fp = fopen(pskfile, "w"); > + fp = fopen(pskfile, "wb"); > if (fp == NULL) { > g_critical("Failed to create pskfile %s", pskfile); > abort(); > Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
diff --git a/tests/crypto-tls-psk-helpers.c b/tests/crypto-tls-psk-helpers.c index a8395477c3..11ae26368c 100644 --- a/tests/crypto-tls-psk-helpers.c +++ b/tests/crypto-tls-psk-helpers.c @@ -32,7 +32,7 @@ void test_tls_psk_init(const char *pskfile) { FILE *fp; - fp = fopen(pskfile, "w"); + fp = fopen(pskfile, "wb"); if (fp == NULL) { g_critical("Failed to create pskfile %s", pskfile); abort();
On windows, if open file with "w", it's will automatically convert "\n" to "\r\n" when writing to file. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> --- tests/crypto-tls-psk-helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)