summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-07-10 19:21:58 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2013-07-10 19:21:58 +0200
commit10b6ce52066ae34485e38a40d038d21ee23ffc70 (patch)
treeb4093c66560dfec28fea5df6c37a275c0a1ee202
parentf1c834f78e52d98921d8529cffdb84e69ff53f01 (diff)
Don't use _s printf variants, not available on old XP msvcrt
-rw-r--r--usbclerk.cpp6
-rw-r--r--vdlog.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/usbclerk.cpp b/usbclerk.cpp
index 7df11f5..8761d83 100644
--- a/usbclerk.cpp
+++ b/usbclerk.cpp
@@ -233,11 +233,11 @@ VOID WINAPI USBClerk::main(DWORD argc, TCHAR* argv[])
TCHAR path[MAX_PATH];
if (GetTempPath(MAX_PATH, path)) {
- swprintf_s(log_path, MAX_PATH, USB_CLERK_LOG_PATH, path);
+ _sntprintf(log_path, MAX_PATH, USB_CLERK_LOG_PATH, path);
s->_log = VDLog::get(log_path);
}
if (GetSystemDirectory(path, MAX_PATH)) {
- sprintf_s(s->_wdi_path, MAX_PATH, USB_DRIVER_PATH, path);
+ _snprintf(s->_wdi_path, MAX_PATH, USB_DRIVER_PATH, path);
}
vd_printf("***Service started***");
SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS);
@@ -464,7 +464,7 @@ bool USBClerk::install_winusb_driver(int vid, int pid)
vd_printf("Device %04x:%04x found", vid, pid);
/* inf filename is built out of vid and pid */
- r = sprintf_s(infname, sizeof(infname), "usb_device_%04x_%04x.inf", vid, pid);
+ r = snprintf(infname, sizeof(infname), "usb_device_%04x_%04x.inf", vid, pid);
if (r <= 0) {
vd_printf("inf file naming failed (%d)", r);
goto cleanup;
diff --git a/vdlog.cpp b/vdlog.cpp
index 02498f2..51182e3 100644
--- a/vdlog.cpp
+++ b/vdlog.cpp
@@ -52,7 +52,7 @@ VDLog* VDLog::get(TCHAR* path)
}
if (size != INVALID_FILE_SIZE && size > LOG_ROLL_SIZE) {
TCHAR roll_path[MAX_PATH];
- swprintf_s(roll_path, MAX_PATH, L"%s.1", path);
+ _sntprintf(roll_path, MAX_PATH, TEXT("%s.1"), path);
if (!MoveFileEx(path, roll_path, MOVEFILE_REPLACE_EXISTING)) {
return NULL;
}