Skip to content

Commit

Permalink
Fix coding style problems
Browse files Browse the repository at this point in the history
  • Loading branch information
loverszhaokai committed Jul 20, 2015
1 parent bc28d8b commit e379bdc
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/fuzz.c
Expand Up @@ -138,7 +138,7 @@ static char * replace_each_chars(char *ciphertext, int *is_replace_finish)
}
replaced_chars_index++;
}
if (4 == replaced_chars_index) {
if (replaced_chars_index == 4) {
replaced_chars_index = 0;
cipher_index++;
}
Expand Down Expand Up @@ -194,7 +194,7 @@ static char * append_last_char(char *origin_ctext, int *is_append_finish)

origin_ctext_len = strlen(origin_ctext);

if (0 == origin_ctext_len || 5 == i) {
if (origin_ctext_len == 0 || i == 5) {
times = 1;
i = 0;
*is_append_finish = 1;
Expand Down Expand Up @@ -237,7 +237,7 @@ static char * change_case(char *origin_ctext, int *is_chgcase_finish)
cipher_index++;
}

if (2 == flag) {
if (flag == 2) {
// Change all to upper cases
pc = fuzz_hash;
while (*pc) {
Expand All @@ -248,7 +248,7 @@ static char * change_case(char *origin_ctext, int *is_chgcase_finish)

flag--;
return fuzz_hash;
} else if (1 == flag) {
} else if (flag == 1) {
// Change all to lower cases
pc = fuzz_hash;
while (*pc) {
Expand Down Expand Up @@ -457,27 +457,27 @@ static char * get_next_fuzz_case(char *label, char *ciphertext)
}

if (!is_replace_finish)
if (NULL != replace_each_chars(ciphertext, &is_replace_finish))
if (replace_each_chars(ciphertext, &is_replace_finish))
return fuzz_hash;

if (!is_swap_finish)
if (NULL != swap_chars(ciphertext, &is_swap_finish))
if (swap_chars(ciphertext, &is_swap_finish))
return fuzz_hash;

if (!is_append_finish)
if (NULL != append_last_char(ciphertext, &is_append_finish))
if (append_last_char(ciphertext, &is_append_finish))
return fuzz_hash;

if (!is_chgcase_finish)
if (NULL != change_case(ciphertext, &is_chgcase_finish))
if (change_case(ciphertext, &is_chgcase_finish))
return fuzz_hash;

if (!is_insertdic_finish)
if (NULL != insert_dic(ciphertext, &is_insertdic_finish))
if (insert_dic(ciphertext, &is_insertdic_finish))
return fuzz_hash;

if (!is_insertchars_finish)
if (NULL != insert_chars(ciphertext, &is_insertchars_finish))
if (insert_chars(ciphertext, &is_insertchars_finish))
return fuzz_hash;

return NULL;
Expand Down

0 comments on commit e379bdc

Please sign in to comment.