1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-17 12:18:24 +00:00

Merge pull request #168 from magnumripper/onesixfour

Do not create a kernel cache file if build failed (actually if size ended up as zero).
This commit is contained in:
Jens Steube 2016-01-27 18:52:10 +01:00
commit af7ff57b3d
2 changed files with 8 additions and 5 deletions

View File

@ -13566,7 +13566,7 @@ int main (int argc, char **argv)
struct stat cst; struct stat cst;
if (stat (cached_file, &cst) == -1) if ((stat (cached_file, &cst) == -1) || cst.st_size == 0)
{ {
cached = 0; cached = 0;
} }

View File

@ -8671,6 +8671,8 @@ void load_kernel (const char *kernel_file, int num_devices, size_t *kernel_lengt
} }
void writeProgramBin (char *dst, u8 *binary, size_t binary_size) void writeProgramBin (char *dst, u8 *binary, size_t binary_size)
{
if (binary_size > 0)
{ {
FILE *fp = fopen (dst, "wb"); FILE *fp = fopen (dst, "wb");
@ -8679,6 +8681,7 @@ void writeProgramBin (char *dst, u8 *binary, size_t binary_size)
fflush (fp); fflush (fp);
fclose (fp); fclose (fp);
} }
}
/** /**
* restore * restore