From 50ea26760da4e0fcf4980e739e1d0ed520de8d59 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Sat, 24 Feb 2007 02:17:47 +0000 Subject: - Avoid sprintf, even when checked copy'n'paste or changes lead to errors --- ext/com_dotnet/com_wrapper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/com_dotnet') diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c index 4cc81aa04b..b698affa22 100644 --- a/ext/com_dotnet/com_wrapper.c +++ b/ext/com_dotnet/com_wrapper.c @@ -74,7 +74,7 @@ static inline void trace(char *fmt, ...) va_list ap; char buf[4096]; - sprintf(buf, "T=%08x ", GetCurrentThreadId()); + snprintf(buf, sizeof(buf), "T=%08x ", GetCurrentThreadId()); OutputDebugString(buf); va_start(ap, fmt); @@ -474,7 +474,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC) &namelen, &pid, 0, &pos))) { char namebuf[32]; if (keytype == HASH_KEY_IS_LONG) { - sprintf(namebuf, "%d", pid); + snprintf(namebuf, sizeof(namebuf), "%d", pid); name = namebuf; namelen = strlen(namebuf)+1; } @@ -506,7 +506,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC) char namebuf[32]; if (keytype == HASH_KEY_IS_LONG) { - sprintf(namebuf, "%d", pid); + snprintf(namebuf, sizeof(namebuf), "%d", pid); name = namebuf; namelen = strlen(namebuf) + 1; } -- cgit v1.2.1