Compare commits
3 commits
00b1bd30f4
...
77b3f80ccc
| Author | SHA1 | Date | |
|---|---|---|---|
| 77b3f80ccc | |||
| 8259ab1614 | |||
| c4a3886504 |
1 changed files with 1 additions and 1 deletions
2
c/ex3.c
2
c/ex3.c
|
|
@ -26,7 +26,7 @@ void reverse_bytes(unsigned char* buf, size_t n) {
|
|||
buf[i] = reverse_byte(buf[i]);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i <= (n / 2); ++i) {
|
||||
for (size_t i = 0; i < ((n + 1) / 2); ++i) {
|
||||
swap_bytes(&buf[i], &buf[n - 1 - i]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue