From b90dd99d09a795b032849dda74075a56ae8d9920 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 5 May 2015 11:41:32 +0200 Subject: [PATCH] Fixing Windows tests --- io_posix.c | 3 ++- io_win32.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/io_posix.c b/io_posix.c index f31d738e4..7f03d5482 100644 --- a/io_posix.c +++ b/io_posix.c @@ -86,6 +86,7 @@ bool ethash_file_size(FILE* f, size_t* ret_size) bool ethash_get_default_dirname(char* strbuf, size_t buffsize) { + static const char dir_suffix[] = ".ethash/"; strbuf[0] = '\0'; char* home_dir = getenv("HOME"); size_t len = strlen(home_dir); @@ -97,5 +98,5 @@ bool ethash_get_default_dirname(char* strbuf, size_t buffsize) return false; } } - return ethash_strncat(strbuf, buffsize, ".ethash/", 8); + return ethash_strncat(strbuf, buffsize, dir_suffix, sizeof(dir_suffix)); } diff --git a/io_win32.c b/io_win32.c index 021aff9c9..d9c54d141 100644 --- a/io_win32.c +++ b/io_win32.c @@ -87,6 +87,7 @@ bool ethash_file_size(FILE* f, size_t* ret_size) bool ethash_get_default_dirname(char* strbuf, size_t buffsize) { + static const char dir_suffix[] = "Appdata\\Ethash\\"; strbuf[0] = '\0'; if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, (WCHAR*)strbuf))) { return false; @@ -95,5 +96,5 @@ bool ethash_get_default_dirname(char* strbuf, size_t buffsize) return false; } - return ethash_strncat(strbuf, buffsize, "Appdata\\Ethash\\", 14); + return ethash_strncat(strbuf, buffsize, dir_suffix, sizeof(dir_suffix)); }