Navigation Menu

Skip to content

Commit

Permalink
windows: -1 for size on Windows
Browse files Browse the repository at this point in the history
Because `n` for `_snprintf_s()` does NOT include terminate
`\0`. (snprintf() in POSIX includes terminate `\0'.)
  • Loading branch information
kou committed Apr 19, 2015
1 parent ab69525 commit ee83eab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/groonga/portability.h
Expand Up @@ -119,7 +119,7 @@

#ifdef WIN32
# define grn_snprintf(dest, dest_size, n, format, ...) \
_snprintf_s((dest), (dest_size), (n), (format), __VA_ARGS__)
_snprintf_s((dest), (dest_size), (n) - 1, (format), __VA_ARGS__)
#else /* WIN32 */
# define grn_snprintf(dest, dest_size, n, format, ...) \
snprintf((dest), (n), (format), __VA_ARGS__)
Expand Down

0 comments on commit ee83eab

Please sign in to comment.