aboutsummaryrefslogtreecommitdiff
path: root/comport
diff options
context:
space:
mode:
authorMartin Peach <mrpeach@users.sourceforge.net>2010-02-01 21:31:12 +0000
committerMartin Peach <mrpeach@users.sourceforge.net>2010-02-01 21:31:12 +0000
commit331644089a1d3fa463f1f12fb6420a7ad1a02462 (patch)
treec1998cb22296a069a2efdc47ca504211a85f4ad8 /comport
parent0c9dd479c60493c62f4a7316bff3908513c878c7 (diff)
Changed some sprintf calls to sprintf_s in the _WIN32 sections.
svn path=/trunk/externals/iem/comport/; revision=13129
Diffstat (limited to 'comport')
-rw-r--r--comport/comport.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/comport/comport.c b/comport/comport.c
index d9ddd92..90b4a7a 100644
--- a/comport/comport.c
+++ b/comport/comport.c
@@ -458,12 +458,12 @@ static HANDLE open_serial(unsigned int com_num, t_comport *x)
return INVALID_HANDLE_VALUE;
}
- sprintf(buffer, "%s%d", x->serial_device_prefix, com_num);
+ sprintf_s(buffer, MAX_PATH, "%s%d", x->serial_device_prefix, com_num);
x->serial_device = gensym(buffer);
}
else
{
- sprintf(buffer, "\\\\.\\%s", x->serial_device->s_name); /* assume the slashes were not prefixed by user */
+ sprintf_s(buffer, MAX_PATH, "\\\\.\\%s", x->serial_device->s_name); /* assume the slashes were not prefixed by user */
x->serial_device = gensym(buffer);
}
post("Opening %s", &x->serial_device->s_name[4]);/* skip slashes and dot */
@@ -1567,7 +1567,7 @@ static void comport_enum(t_comport *x)
DWORD dw;
for(i = 1; i < COMPORT_MAX; i++)
{
- sprintf(device_name, "%s%d", x->serial_device_prefix, i);
+ sprintf_s(device_name, 10, "%s%d", x->serial_device_prefix, i);
fd = CreateFileA( device_name,
GENERIC_READ | GENERIC_WRITE,
0,
@@ -1631,7 +1631,7 @@ static void comport_ports(t_comport *x)
for(i = 1; i < COMPORT_MAX; i++)
{
- sprintf(device_name, "%s%d", x->serial_device_prefix, i);
+ sprintf_s(device_name, 10, "%s%d", x->serial_device_prefix, i);
fd = CreateFileA( device_name,
GENERIC_READ | GENERIC_WRITE,
0,