Skip to content

Commit d4b7894

Browse files
committed
Code refactorying to avoid unnecessary assignment
1 parent f1fedab commit d4b7894

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

hdump.c

+8-5
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,15 @@ int main(int argc, char *argv[])
114114
/* imprime os bytes separados por espaço */
115115
printf("%02x%*c", (unsigned int) *(buff+i), (i+1 == cols/2) ? 2 : 1, ' ');
116116

117-
/* define o fim do array ascii (sera usado como string) */
118-
*(ascii+bread) = '\0';
119-
120-
/* imprime os caracteres ascii */
121-
if (i == bread-1)
117+
/*
118+
* define o final do array asciii (será usado como string)
119+
* imprime os caracteres ascii
120+
*/
121+
if (i == bread-1)
122+
{
123+
*(ascii+bread) = '\0';
122124
printf("%*c|%s|\n", get_spaces(bread, cols), ' ', ascii);
125+
}
123126
}
124127
/* atualiza o numero de endereços lidos */
125128
address += bread;

0 commit comments

Comments
 (0)