snprintf in http2.c

2013-09-06 Thread Gisle Vanem

I built NgHTTP2 some days ago using MSVC 2010. I was amazed
of how easy it was. Not very Unix/Posix centric at all. But using the
first little merge of nghttp2 into libcurl, I stumbeled on the missing
'snprintf' in MSVCRT. Isn't this how we do it for other libcurl files?
I.e. use 'curl_msnprintf' and not 'snprintf' directly:

--- Git-latest/lib/http2.c   2013-09-05 13:47:19 +
+++ lib/http2.c 2013-09-06 09:52:57 +
@@ -22,6 +22,9 @@

#include curl_setup.h

+#define _MPRINTF_REPLACE
+#include curl/mprintf.h
+
#ifdef USE_NGHTTP2
#include nghttp2/nghttp2.h
#include http2.h


--gv
---
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html


Re: snprintf in http2.c

2013-09-06 Thread Daniel Stenberg

On Fri, 6 Sep 2013, Gisle Vanem wrote:

I built NgHTTP2 some days ago using MSVC 2010. I was amazed of how easy it 
was. Not very Unix/Posix centric at all. But using the first little merge of 
nghttp2 into libcurl, I stumbeled on the missing 'snprintf' in MSVCRT. Isn't 
this how we do it for other libcurl files? I.e. use 'curl_msnprintf' and not 
'snprintf' directly:


Right, thanks. This is also why I like to push things like this early, since 
there are always a lot of these details that I tend to miss...


I moved the include line to below the #ifdef USE_NGHTTP2 to prevent extra 
processing time when not building with http2 support enabled.


Fix pushed!

--

 / daniel.haxx.se
---
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html