From c13ef5aacda21b7db4482231b26e02d8e4ae763e Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 16 Nov 2016 20:30:14 -0800 Subject: [PATCH] Fix formats found by cppcheck --- src/interface.c | 10 +++++----- src/opencl.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/interface.c b/src/interface.c index f92de66f2..56045321e 100644 --- a/src/interface.c +++ b/src/interface.c @@ -14439,7 +14439,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const u32 salt_pos, base64_encode (int_to_base64, (const u8 *) digest_buf, 32, (u8 *) tmp_buf); - snprintf (out_buf, len-1, "%s:%i:%i:%i:%s:%s", + snprintf (out_buf, len-1, "%s:%u:%u:%u:%s:%s", SIGNATURE_SCRYPT, N, r, @@ -15477,7 +15477,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const u32 salt_pos, if (version == 1) final_random_seed_len = 4; - snprintf (out_buf, len-1, "%s*%d*%d*%d", + snprintf (out_buf, len-1, "%s*%u*%u*%u", SIGNATURE_KEEPASS, version, rounds, @@ -15528,9 +15528,9 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const u32 salt_pos, char ptr_contents_len[10] = { 0 }; - sprintf ((char*) ptr_contents_len, "%d", contents_len); + sprintf ((char*) ptr_contents_len, "%u", contents_len); - sprintf (ptr_data, "%d", contents_len); + sprintf (ptr_data, "%u", contents_len); ptr_data += strlen(ptr_contents_len); @@ -15566,7 +15566,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const u32 salt_pos, *ptr_data = '*'; ptr_data++; - sprintf (ptr_data, "%d", keyfile_len); + sprintf (ptr_data, "%u", keyfile_len); ptr_data += 2; diff --git a/src/opencl.c b/src/opencl.c index 414df731d..a0f0374a7 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -160,12 +160,12 @@ static void generate_cached_kernel_mp_filename (const u32 opti_type, const u32 o static void generate_source_kernel_amp_filename (const u32 attack_kern, char *shared_dir, char *source_file) { - snprintf (source_file, 255, "%s/OpenCL/amp_a%d.cl", shared_dir, attack_kern); + snprintf (source_file, 255, "%s/OpenCL/amp_a%u.cl", shared_dir, attack_kern); } static void generate_cached_kernel_amp_filename (const u32 attack_kern, char *profile_dir, const char *device_name_chksum, char *cached_file) { - snprintf (cached_file, 255, "%s/kernels/amp_a%d.%s.kernel", profile_dir, attack_kern, device_name_chksum); + snprintf (cached_file, 255, "%s/kernels/amp_a%u.%s.kernel", profile_dir, attack_kern, device_name_chksum); } static int setup_opencl_platforms_filter (hashcat_ctx_t *hashcat_ctx, const char *opencl_platforms, u32 *out)