aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/win32/sys.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2012-09-07 15:21:13 +0200
committerBjörn-Egil Dahlberg <[email protected]>2012-09-07 17:01:08 +0200
commit32286d6523d0f46163f1c5e23253516d61c46c78 (patch)
tree6011f537893669d88523beedfc7eadc5040b739e /erts/emulator/sys/win32/sys.c
parent7bd69516a3cab79f869fde5787140ae810c35ef8 (diff)
downloadotp-32286d6523d0f46163f1c5e23253516d61c46c78.tar.gz
otp-32286d6523d0f46163f1c5e23253516d61c46c78.tar.bz2
otp-32286d6523d0f46163f1c5e23253516d61c46c78.zip
Replace sprintf with erts_snprintf in beam
Diffstat (limited to 'erts/emulator/sys/win32/sys.c')
-rwxr-xr-xerts/emulator/sys/win32/sys.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c
index 6894d682e7..1c9f8ebf43 100755
--- a/erts/emulator/sys/win32/sys.c
+++ b/erts/emulator/sys/win32/sys.c
@@ -2764,10 +2764,10 @@ static void stop_select(ErlDrvEvent e, void* _)
** no interpretation of this should be done by the rest of the
** emulator. The buffer should be at least 21 bytes long.
*/
-void sys_get_pid(char *buffer){
+void sys_get_pid(char *buffer, size_t buffer_size){
DWORD p = GetCurrentProcessId();
/* The pid is scalar and is an unsigned long. */
- sprintf(buffer,"%lu",(unsigned long) p);
+ erts_snprintf(buffer, buffer_size, "%lu",(unsigned long) p);
}
void
@@ -3107,7 +3107,8 @@ erl_assert_error(char* expr, char* file, int line)
{
char message[1024];
- sprintf(message, "File %hs, line %d: %hs", file, line, expr);
+ erts_snprintf(message, sizeof(message),
+ "File %hs, line %d: %hs", file, line, expr);
MessageBox(GetActiveWindow(), message, "Assertion failed",
MB_OK | MB_ICONERROR);
#if 0