Skip to content

Commit

Permalink
Use the system snprintf/vsnprintf when available.
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin committed Jul 6, 2009
1 parent 6df4a84 commit 8c1f7d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ else
AC_C_BIGENDIAN([byteorder=1234], [byteorder=4321], [], [])
fi

AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(vsnprintf)

if test "x$with_libxml2" = xyes; then
with_parser=libxml2
PARSER_NAME=libxml2
Expand Down
9 changes: 9 additions & 0 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,16 @@ void disconnect_mem_error(xmpp_conn_t * const conn);
void auth_handle_open(xmpp_conn_t * const conn);

/* replacement snprintf and vsnprintf */
#ifdef HAVE_SNPRINTF
# define xmpp_snprintf snprintf
#else
int xmpp_snprintf (char *str, size_t count, const char *fmt, ...);
#endif

#ifdef HAVE_VSNPRINTF
# define xmpp_vsnprintf vsnprintf
#else
int xmpp_vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
#endif

#endif /* __LIBSTROPHE_COMMON_H__ */

0 comments on commit 8c1f7d9

Please sign in to comment.