[Groonga-commit] groonga/groonga at f841f86 [master] windows: really fix last 1 byte bug of vsnprintf/snrpintf

Back to archive index

Kouhei Sutou null+****@clear*****
Sun May 22 16:29:30 JST 2016


Kouhei Sutou	2016-05-22 16:29:30 +0900 (Sun, 22 May 2016)

  New Revision: f841f86ad149739f9f097caf4470781a0d8a903f
  https://github.com/groonga/groonga/commit/f841f86ad149739f9f097caf4470781a0d8a903f

  Message:
    windows: really fix last 1 byte bug of vsnprintf/snrpintf

  Modified files:
    include/groonga/portability.h

  Modified: include/groonga/portability.h (+1 -2)
===================================================================
--- include/groonga/portability.h    2016-05-22 16:24:24 +0900 (d3720fb)
+++ include/groonga/portability.h    2016-05-22 16:29:30 +0900 (801aa48)
@@ -136,7 +136,6 @@
 #ifdef WIN32
 # define grn_snprintf(dest, dest_size, n, ...) do {             \
     _snprintf_s((dest), (dest_size), (n) - 1, __VA_ARGS__);     \
-    (dest)[(n) - 1] = '\0';                                     \
   } while (GRN_FALSE)
 #else /* WIN32 */
 # define grn_snprintf(dest, dest_size, n, ...)  \
@@ -145,7 +144,7 @@
 
 #ifdef WIN32
 # define grn_vsnprintf(dest, dest_size, format, args) do {      \
-    vsnprintf((dest), (dest_size) - 1, (format), (args));       \
+    vsnprintf((dest), (dest_size), (format), (args));           \
     (dest)[(dest_size) - 1] = '\0';                             \
   } while (GRN_FALSE)
 #else /* WIN32 */
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index