Bug 821003: Replace snprintf macro with static function r=jesup
authorAdam Roach [:abr] <adam@nostrum.com>
Fri, 21 Dec 2012 14:55:41 -0600
changeset 125979 6fe65eeaa2b4c988400c28a2c4476ed4d209d636
parent 125978 8667a82f1bf2fc117a86dbe3abbedcd81335c175
child 125980 7b76a1d0adf5ec9df21816568b3f637c8be75803
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs821003
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 821003: Replace snprintf macro with static function r=jesup
media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_stdio.c
media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_stdio.h
--- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_stdio.c
+++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_stdio.c
@@ -62,8 +62,19 @@ buginf (const char *_format, ...)
 
   va_start(ap, _format);
   CSFLogDebugV("cpr", _format, ap);
   va_end(ap);
 
   return (0);
 }
 
+int
+cpr_win_snprintf(char *buffer, size_t n, const char *format, ...)
+{
+  va_list argp;
+  int ret;
+  va_start(argp, format);
+  ret = _vscprintf(format, argp);
+  vsnprintf_s(buffer, n, _TRUNCATE, format, argp);
+  va_end(argp);
+  return ret;
+}
--- a/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_stdio.h
+++ b/media/webrtc/signaling/src/sipcc/cpr/win32/cpr_win_stdio.h
@@ -4,11 +4,12 @@
 
 #ifndef _CPR_WIN_STDIO_H_
 #define _CPR_WIN_STDIO_H_
 
 #include "cpr_types.h"
 #include <stdio.h>
 
 
-#define snprintf _snprintf
+#define snprintf cpr_win_snprintf
+int cpr_win_snprintf(char *buffer, size_t n, const char *format, ...);
 
 #endif