1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-27 02:18:21 +00:00

Merge pull request #560 from matrix/fix_string_format

Fix string format
This commit is contained in:
Jens Steube 2016-10-30 19:31:52 +01:00 committed by GitHub
commit 25bc960a09
3 changed files with 13 additions and 13 deletions

View File

@ -2572,9 +2572,9 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
char *device_name_chksum = (char *) hcmalloc (hashcat_ctx, HCBUFSIZ_TINY); VERIFY_PTR (device_name_chksum);
#if defined (__x86_64__)
snprintf (device_name_chksum, HCBUFSIZ_TINY - 1, "%u-%u-%u-%s-%s-%s-%u", 64, device_param->platform_vendor_id, device_param->vector_width, device_param->device_name, device_param->device_version, device_param->driver_version, comptime);
snprintf (device_name_chksum, HCBUFSIZ_TINY - 1, "%d-%u-%u-%s-%s-%s-%d", 64, device_param->platform_vendor_id, device_param->vector_width, device_param->device_name, device_param->device_version, device_param->driver_version, comptime);
#else
snprintf (device_name_chksum, HCBUFSIZ_TINY - 1, "%u-%u-%u-%s-%s-%s-%u", 32, device_param->platform_vendor_id, device_param->vector_width, device_param->device_name, device_param->device_version, device_param->driver_version, comptime);
snprintf (device_name_chksum, HCBUFSIZ_TINY - 1, "%d-%u-%u-%s-%s-%s-%d", 32, device_param->platform_vendor_id, device_param->vector_width, device_param->device_name, device_param->device_version, device_param->driver_version, comptime);
#endif
u32 device_name_digest[4] = { 0 };
@ -3452,7 +3452,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
snprintf (build_opts_new, sizeof (build_opts_new) - 1, "%s -D VENDOR_ID=%u -D CUDA_ARCH=%d -D VECT_SIZE=%u -D DEVICE_TYPE=%u -D DGST_R0=%u -D DGST_R1=%u -D DGST_R2=%u -D DGST_R3=%u -D DGST_ELEM=%u -D KERN_TYPE=%u -D _unroll -cl-std=CL1.1 -w", build_opts, device_param->device_vendor_id, (device_param->sm_major * 100) + device_param->sm_minor, device_param->vector_width, (u32) device_param->device_type, hashconfig->dgst_pos0, hashconfig->dgst_pos1, hashconfig->dgst_pos2, hashconfig->dgst_pos3, hashconfig->dgst_size / 4, hashconfig->kern_type);
#endif
strncpy (build_opts, build_opts_new, sizeof (build_opts));
strncpy (build_opts, build_opts_new, sizeof (build_opts) - 1);
#if defined (DEBUG)
if (user_options->quiet == false) event_log_warning (hashcat_ctx, "* Device #%u: build_opts '%s'", device_id + 1, build_opts);

View File

@ -482,7 +482,7 @@ int outfile_and_hashfile (hashcat_ctx_t *hashcat_ctx)
fclose (tmp_hashfile_fp);
}
if (tmp_outfile_fp && tmp_outfile_fp)
if (tmp_outfile_fp)
{
tmpstat_outfile.st_mode = 0;
tmpstat_outfile.st_nlink = 0;

View File

@ -1381,7 +1381,7 @@ char *status_get_cpt (const hashcat_ctx_t *hashcat_ctx)
if ((cpt_ctx->cpt_start + 86400) < now)
{
snprintf (cpt, HCBUFSIZ_TINY - 1, "CUR:%u,%u,%u AVG:%0.2f,%0.2f,%0.2f (Min,Hour,Day)",
snprintf (cpt, HCBUFSIZ_TINY - 1, "CUR:%d,%d,%d AVG:%0.2f,%0.2f,%0.2f (Min,Hour,Day)",
cpt_cur_min,
cpt_cur_hour,
cpt_cur_day,
@ -1391,7 +1391,7 @@ char *status_get_cpt (const hashcat_ctx_t *hashcat_ctx)
}
else if ((cpt_ctx->cpt_start + 3600) < now)
{
snprintf (cpt, HCBUFSIZ_TINY - 1, "CUR:%u,%u,N/A AVG:%0.2f,%0.2f,%0.2f (Min,Hour,Day)",
snprintf (cpt, HCBUFSIZ_TINY - 1, "CUR:%d,%d,N/A AVG:%0.2f,%0.2f,%0.2f (Min,Hour,Day)",
cpt_cur_min,
cpt_cur_hour,
cpt_avg_min,
@ -1400,7 +1400,7 @@ char *status_get_cpt (const hashcat_ctx_t *hashcat_ctx)
}
else if ((cpt_ctx->cpt_start + 60) < now)
{
snprintf (cpt, HCBUFSIZ_TINY - 1, "CUR:%u,N/A,N/A AVG:%0.2f,%0.2f,%0.2f (Min,Hour,Day)",
snprintf (cpt, HCBUFSIZ_TINY - 1, "CUR:%d,N/A,N/A AVG:%0.2f,%0.2f,%0.2f (Min,Hour,Day)",
cpt_cur_min,
cpt_avg_min,
cpt_avg_hour,
@ -1445,42 +1445,42 @@ char *status_get_hwmon_dev (const hashcat_ctx_t *hashcat_ctx, const int device_i
if (num_temperature >= 0)
{
snprintf (output_buf + output_len, HCBUFSIZ_TINY - output_len, "Temp:%3uc ", num_temperature);
snprintf (output_buf + output_len, HCBUFSIZ_TINY - output_len, "Temp:%3dc ", num_temperature);
output_len = strlen (output_buf);
}
if (num_fanspeed >= 0)
{
snprintf (output_buf + output_len, HCBUFSIZ_TINY - output_len, "Fan:%3u%% ", num_fanspeed);
snprintf (output_buf + output_len, HCBUFSIZ_TINY - output_len, "Fan:%3d%% ", num_fanspeed);
output_len = strlen (output_buf);
}
if (num_utilization >= 0)
{
snprintf (output_buf + output_len, HCBUFSIZ_TINY - output_len, "Util:%3u%% ", num_utilization);
snprintf (output_buf + output_len, HCBUFSIZ_TINY - output_len, "Util:%3d%% ", num_utilization);
output_len = strlen (output_buf);
}
if (num_corespeed >= 0)
{
snprintf (output_buf + output_len, HCBUFSIZ_TINY - output_len, "Core:%4uMhz ", num_corespeed);
snprintf (output_buf + output_len, HCBUFSIZ_TINY - output_len, "Core:%4dMhz ", num_corespeed);
output_len = strlen (output_buf);
}
if (num_memoryspeed >= 0)
{
snprintf (output_buf + output_len, HCBUFSIZ_TINY - output_len, "Mem:%4uMhz ", num_memoryspeed);
snprintf (output_buf + output_len, HCBUFSIZ_TINY - output_len, "Mem:%4dMhz ", num_memoryspeed);
output_len = strlen (output_buf);
}
if (num_buslanes >= 0)
{
snprintf (output_buf + output_len, HCBUFSIZ_TINY - output_len, "Lanes:%u ", num_buslanes);
snprintf (output_buf + output_len, HCBUFSIZ_TINY - output_len, "Lanes:%d ", num_buslanes);
output_len = strlen (output_buf);
}