Browse Source

Fixing Windows tests

cl-refactor
Lefteris Karapetsas 10 years ago
parent
commit
b90dd99d09
  1. 3
      io_posix.c
  2. 3
      io_win32.c

3
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));
}

3
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));
}

Loading…
Cancel
Save