From 1f8bcd7af24a4d53428577bfd7e955218e1fa4cc Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 6 Nov 2011 23:38:39 +0000 Subject: [PATCH] [KERNEL32_WINETEST] - Do not use strcat_s. It is not guaranteed to exist on Windows. svn path=/trunk/; revision=54324 --- rostests/winetests/kernel32/dosdev.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/rostests/winetests/kernel32/dosdev.c b/rostests/winetests/kernel32/dosdev.c index 180fb16017a..fab58ea343c 100644 --- a/rostests/winetests/kernel32/dosdev.c +++ b/rostests/winetests/kernel32/dosdev.c @@ -19,6 +19,7 @@ */ #include +#include #include "wine/test.h" #include "windef.h" @@ -235,8 +236,7 @@ static void test_DefineDosDeviceA(void) /* Test with trailing '\' appended to TargetPath */ dwMaskPrev = GetLogicalDrives(); - strcpy_s(Buffer, MAX_PATH, Target); - strcat_s(Buffer, MAX_PATH, "\\\\\\"); + snprintf(Buffer, sizeof(Buffer), "%s\\\\\\", Target); Result = DefineDosDeviceA(0, SUBST_DRIVE, Buffer); ok(Result, "Failed to subst drive\n"); DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); @@ -256,9 +256,7 @@ static void test_DefineDosDeviceA(void) /* Test with trailing '\' appended to TargetPath and DDD_RAW_TARGET_PATH flag */ dwMaskPrev = GetLogicalDrives(); - strcpy_s(Buffer, MAX_PATH, "\\??\\"); - strcat_s(Buffer, MAX_PATH, Target); - strcat_s(Buffer, MAX_PATH, "\\\\\\"); + snprintf(Buffer, sizeof(Buffer), "\\??\\%s\\\\\\", Target); Result = DefineDosDeviceA(DDD_RAW_TARGET_PATH, SUBST_DRIVE, Buffer); ok(Result, "Failed to subst drive\n"); DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR);