gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r34759 - in libmicrohttpd/src: include microhttpd


From: gnunet
Subject: [GNUnet-SVN] r34759 - in libmicrohttpd/src: include microhttpd
Date: Mon, 22 Dec 2014 20:42:18 +0100

Author: Karlson2k
Date: 2014-12-22 20:42:18 +0100 (Mon, 22 Dec 2014)
New Revision: 34759

Modified:
   libmicrohttpd/src/include/platform_interface.h
   libmicrohttpd/src/microhttpd/basicauth.c
   libmicrohttpd/src/microhttpd/connection.c
   libmicrohttpd/src/microhttpd/digestauth.c
Log:
Replace snprintf with platform-independent macro

Modified: libmicrohttpd/src/include/platform_interface.h
===================================================================
--- libmicrohttpd/src/include/platform_interface.h      2014-12-22 19:42:08 UTC 
(rev 34758)
+++ libmicrohttpd/src/include/platform_interface.h      2014-12-22 19:42:18 UTC 
(rev 34759)
@@ -72,8 +72,15 @@
 #define MHD_str_equal_caseless_n_(a,b,n) (0==_strnicmp((a),(b),(n)))
 #endif
 
+/* Platform-independent snprintf name */
+#if !defined(_WIN32) || defined(__CYGWIN__)
+#define MHD_snprintf_ snprintf
+#else
+#define MHD_snprintf_ W32_snprintf
+#endif
 
 
+
 /* MHD_socket_close_(fd) close any FDs (non-W32) / close only socket FDs (W32) 
*/
 #if !defined(_WIN32) || defined(__CYGWIN__)
 #define MHD_socket_close_(fd) close((fd))

Modified: libmicrohttpd/src/microhttpd/basicauth.c
===================================================================
--- libmicrohttpd/src/microhttpd/basicauth.c    2014-12-22 19:42:08 UTC (rev 
34758)
+++ libmicrohttpd/src/microhttpd/basicauth.c    2014-12-22 19:42:18 UTC (rev 
34759)
@@ -121,7 +121,7 @@
   size_t hlen = strlen(realm) + strlen("Basic realm=\"\"") + 1;
   char header[hlen];
 
-  snprintf (header, 
+  MHD_snprintf_ (header, 
            sizeof (header), 
            "Basic realm=\"%s\"", 
            realm);

Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c   2014-12-22 19:42:08 UTC (rev 
34758)
+++ libmicrohttpd/src/microhttpd/connection.c   2014-12-22 19:42:18 UTC (rev 
34759)
@@ -476,7 +476,7 @@
     }
   if (ret > 0xFFFFFF)
     ret = 0xFFFFFF;
-  snprintf (cbuf,
+  MHD_snprintf_ (cbuf,
            sizeof (cbuf),
            "%X\r\n", (unsigned int) ret);
   cblen = strlen (cbuf);

Modified: libmicrohttpd/src/microhttpd/digestauth.c
===================================================================
--- libmicrohttpd/src/microhttpd/digestauth.c   2014-12-22 19:42:08 UTC (rev 
34758)
+++ libmicrohttpd/src/microhttpd/digestauth.c   2014-12-22 19:42:18 UTC (rev 
34759)
@@ -791,7 +791,7 @@
       return MHD_NO;
     }
   /* Building the authentication header */
-  hlen = snprintf (NULL,
+  hlen = MHD_snprintf_(NULL,
                   0,
                   "Digest 
realm=\"%s\",qop=\"auth\",nonce=\"%s\",opaque=\"%s\"%s",
                   realm,
@@ -803,7 +803,7 @@
   {
     char header[hlen + 1];
 
-    snprintf (header,
+    MHD_snprintf_(header,
              sizeof(header),
              "Digest realm=\"%s\",qop=\"auth\",nonce=\"%s\",opaque=\"%s\"%s",
              realm,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]