From 65aa190617d32e4778c2b553e0f069028cf975d9 Mon Sep 17 00:00:00 2001 From: "josh.macdonald" Date: Wed, 27 Jun 2012 06:34:27 +0000 Subject: remove strcat, sprintf --- xdelta3/xdelta3-internal.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'xdelta3/xdelta3-internal.h') diff --git a/xdelta3/xdelta3-internal.h b/xdelta3/xdelta3-internal.h index fd01208..871bcfb 100644 --- a/xdelta3/xdelta3-internal.h +++ b/xdelta3/xdelta3-internal.h @@ -95,11 +95,19 @@ struct _main_file * absence of the '_' prefix) but they were initially buggy. So, * always use the native '_'-prefixed version with Win32. */ #ifdef _WIN32 -#define vsnprintf_func _vsnprintf +#define vsnprintf_func(str,size,fmt,args) \ + _vsnprintf_s(str,size,size-1,fmt,args) #else #define vsnprintf_func vsnprintf +#define short_sprintf(sb,fmt,...) \ + snprintf((sb).buf,sizeof((sb).buf),fmt,__VA_ARGS__) #endif +/* Type used for short snprintf calls. */ +typedef struct { + char buf[48]; +} shortbuf; + /* Prior to SVN 303 this function was only defined in DJGPP and WIN32 * environments and other platforms would use the builtin snprintf() * with an arrangement of macros below. In OS X 10.6, Apply made -- cgit v1.2.3