Remove complicated checks after memory allocation and in case of error print to stderr instead. This makes the memory allocation functions more natural to use.

This commit is contained in:
jsteube
2016-11-20 22:54:52 +01:00
parent 11c5d86d40
commit ea4fd1de50
35 changed files with 290 additions and 293 deletions

View File

@@ -83,12 +83,12 @@ int logfile_init (hashcat_ctx_t *hashcat_ctx)
if (user_options->logfile_disable == true) return 0;
logfile_ctx->logfile = (char *) hcmalloc (hashcat_ctx, HCBUFSIZ_TINY); VERIFY_PTR (logfile_ctx->logfile);
logfile_ctx->logfile = (char *) hcmalloc (HCBUFSIZ_TINY);
snprintf (logfile_ctx->logfile, HCBUFSIZ_TINY - 1, "%s/%s.log", folder_config->session_dir, user_options->session);
logfile_ctx->subid = (char *) hcmalloc (hashcat_ctx, HCBUFSIZ_TINY); VERIFY_PTR (logfile_ctx->subid);
logfile_ctx->topid = (char *) hcmalloc (hashcat_ctx, HCBUFSIZ_TINY); VERIFY_PTR (logfile_ctx->topid);
logfile_ctx->subid = (char *) hcmalloc (HCBUFSIZ_TINY);
logfile_ctx->topid = (char *) hcmalloc (HCBUFSIZ_TINY);
logfile_ctx->enabled = true;