mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[winpr,file] fix strcat warning
This commit is contained in:
@@ -28,20 +28,15 @@ static BOOL get_tmp(char* path, size_t len)
|
||||
strncmp(path, template, strnlen_s(template, len) + 1);
|
||||
if (!mktemp_s(path))
|
||||
return FALSE;
|
||||
strcat_s(path, len, "\\testfile");
|
||||
if (strnlen_s(path, len) + 10 > len)
|
||||
return FALSE;
|
||||
return winpr_str_append("testfile", path, len, "\\");
|
||||
#else
|
||||
const char template[] = "/tmp/tmpdir.XXXXXX";
|
||||
if (!strncpy(path, template, strnlen(template, len) + 1))
|
||||
return FALSE;
|
||||
if (!mkdtemp(path))
|
||||
return FALSE;
|
||||
if (strnlen(path, len) + 10 > len)
|
||||
return FALSE;
|
||||
strcat(path, "/testfile");
|
||||
return winpr_str_append("testfile", path, len, "/");
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL test_write(const char* filename, const char* data, size_t datalen)
|
||||
|
||||
Reference in New Issue
Block a user