if (device_param->skipped) continue;
- char display_dev_cur[16];
-
- memset (display_dev_cur, 0, sizeof (display_dev_cur));
+ char display_dev_cur[16] = { 0 };
strncpy (display_dev_cur, "0.00", 4);
log_info ("Speed.Dev.#%d...: %9sH/s", device_id + 1, display_dev_cur);
}
- char display_all_cur[16];
-
- memset (display_all_cur, 0, sizeof (display_all_cur));
+ char display_all_cur[16] = { 0 };
strncpy (display_all_cur, "0.00", 4);
if (device_param->skipped) continue;
- char display_dev_cur[16];
-
- memset (display_dev_cur, 0, sizeof (display_dev_cur));
+ char display_dev_cur[16] = { 0 };
strncpy (display_dev_cur, "0.00", 4);
log_info ("Speed.Dev.#%d.: %9sH/s", device_id + 1, display_dev_cur);
}
- char display_all_cur[16];
-
- memset (display_all_cur, 0, sizeof (display_all_cur));
+ char display_all_cur[16] = { 0 };
strncpy (display_all_cur, "0.00", 4);
// hash
- char out_buf[4096]; memset (out_buf, 0, sizeof (out_buf));
+ char out_buf[4096] = { 0 };
ascii_digest (out_buf, salt_pos, digest_pos);
{
char *hashfile = data.hashfile;
- char new_hashfile[256];
- char old_hashfile[256];
-
- memset (new_hashfile, 0, sizeof (new_hashfile));
- memset (old_hashfile, 0, sizeof (old_hashfile));
+ char new_hashfile[256] = { 0 };
+ char old_hashfile[256] = { 0 };
snprintf (new_hashfile, 255, "%s.new", hashfile);
snprintf (old_hashfile, 255, "%s.old", hashfile);
if (data.hash_mode != 2500)
{
- char out_buf[4096];
-
- memset (out_buf, 0, sizeof (out_buf));
+ char out_buf[4096] = { 0 };
if (data.username == 1)
{
if (run_rule_engine (data.rule_len_r, data.rule_buf_r))
{
- char rule_buf_out[BLOCK_SIZE];
-
- memset (rule_buf_out, 0, sizeof (rule_buf_out));
+ char rule_buf_out[BLOCK_SIZE] = { 0 };
int rule_len_out = _old_apply_rule (data.rule_buf_r, data.rule_len_r, line_buf, line_len, rule_buf_out);
if (run_rule_engine (data.rule_len_l, data.rule_buf_l))
{
- char rule_buf_out[BLOCK_SIZE];
-
- memset (rule_buf_out, 0, sizeof (rule_buf_out));
+ char rule_buf_out[BLOCK_SIZE] = { 0 };
int rule_len_out = -1;
if (run_rule_engine (data.rule_len_l, data.rule_buf_l))
{
- char rule_buf_out[BLOCK_SIZE];
-
- memset (rule_buf_out, 0, sizeof (rule_buf_out));
+ char rule_buf_out[BLOCK_SIZE] = { 0 };
int rule_len_out = -1;
int (*parse_func) (char *, uint, hash_t *) = data.parse_func;
// buffers
- hash_t hash_buf;
-
- memset (&hash_buf, 0, sizeof (hash_buf));
+ hash_t hash_buf = { 0, 0, 0, 0, 0 };
hash_buf.digest = mymalloc (dgst_size);
if (run_rule_engine (data.rule_len_l, data.rule_buf_l))
{
- char rule_buf_out[BLOCK_SIZE];
-
- memset (rule_buf_out, 0, sizeof (rule_buf_out));
+ char rule_buf_out[BLOCK_SIZE] = { 0 };
int rule_len_out = -1;
if (run_rule_engine (data.rule_len_l, data.rule_buf_l))
{
- char rule_buf_out[BLOCK_SIZE];
-
- memset (rule_buf_out, 0, sizeof (rule_buf_out));
+ char rule_buf_out[BLOCK_SIZE] = { 0 };
int rule_len_out = -1;
* potfile
*/
- char potfile[256];
-
- memset (potfile, 0, sizeof (potfile));
+ char potfile[256] = { 0 };
snprintf (potfile, sizeof (potfile) - 1, "%s/%s.pot", session_dir, session);
* charsets : keep them together for more easy maintainnce
*/
- cs_t mp_sys[6];
- cs_t mp_usr[4];
-
- memset (mp_sys, 0, sizeof (mp_sys));
- memset (mp_usr, 0, sizeof (mp_usr));
+ cs_t mp_sys[6] = { { { 0 }, 0 } };
+ cs_t mp_usr[4] = { { { 0 }, 0 } };
mp_setup_sys (mp_sys);
{
cl_platform_id platform = platforms[platform_id];
- char platform_vendor[INFOSZ];
-
- memset (platform_vendor, 0, sizeof (platform_vendor));
+ char platform_vendor[INFOSZ] = { 0 };
hc_clGetPlatformInfo (platform, CL_PLATFORM_VENDOR, sizeof (platform_vendor), platform_vendor, NULL);
* HM devices: init
*/
- hm_attrs_t hm_adapters_nv[DEVICES_MAX];
- hm_attrs_t hm_adapters_amd[DEVICES_MAX];
-
- memset (hm_adapters_nv, 0, sizeof (hm_adapters_nv));
- memset (hm_adapters_amd, 0, sizeof (hm_adapters_amd));
+ hm_attrs_t hm_adapters_nv[DEVICES_MAX] = { { { 0 }, 0, 0 } };
+ hm_attrs_t hm_adapters_amd[DEVICES_MAX] = { { { 0 }, 0, 0 } };
if (gpu_temp_disable == 0)
{
* kernel source filename
*/
- char source_file[256];
-
- memset (source_file, 0, sizeof (source_file));
+ char source_file[256] = { 0 };
generate_source_kernel_filename (attack_exec, attack_kern, kern_type, shared_dir, source_file);
* kernel cached filename
*/
- char cached_file[256];
-
- memset (cached_file, 0, sizeof (cached_file));
+ char cached_file[256] = { 0 };
generate_cached_kernel_filename (attack_exec, attack_kern, kern_type, profile_dir, device_name_chksum, cached_file);
* kernel mp source filename
*/
- char source_file[256];
-
- memset (source_file, 0, sizeof (source_file));
+ char source_file[256] = { 0 };
generate_source_kernel_mp_filename (opti_type, opts_type, shared_dir, source_file);
* kernel mp cached filename
*/
- char cached_file[256];
-
- memset (cached_file, 0, sizeof (cached_file));
+ char cached_file[256] = { 0 };
generate_cached_kernel_mp_filename (opti_type, opts_type, profile_dir, device_name_chksum, cached_file);
* kernel amp source filename
*/
- char source_file[256];
-
- memset (source_file, 0, sizeof (source_file));
+ char source_file[256] = { 0 };
generate_source_kernel_amp_filename (attack_kern, shared_dir, source_file);
* kernel amp cached filename
*/
- char cached_file[256];
-
- memset (cached_file, 0, sizeof (cached_file));
+ char cached_file[256] = { 0 };
generate_cached_kernel_amp_filename (attack_kern, profile_dir, device_name_chksum, cached_file);
* kernel name
*/
- char kernel_name[64];
-
- memset (kernel_name, 0, sizeof (kernel_name));
+ char kernel_name[64] = { 0 };
if (attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
{
data.css_cnt = css_cnt;
data.css_buf = css_buf;
- uint uniq_tbls[SP_PW_MAX][CHARSIZ];
-
- memset (uniq_tbls, 0, sizeof (uniq_tbls));
+ uint uniq_tbls[SP_PW_MAX][CHARSIZ] = { { 0 } };
mp_css_to_uniq_tbl (css_cnt, css_buf, uniq_tbls);
if (maskpos > 0 && dictpos == 0) free (masks[maskpos - 1]);
- uint uniq_tbls[SP_PW_MAX][CHARSIZ];
-
- memset (uniq_tbls, 0, sizeof (uniq_tbls));
+ uint uniq_tbls[SP_PW_MAX][CHARSIZ] = { { 0 } };
mp_css_to_uniq_tbl (css_cnt, css_buf, uniq_tbls);