Skip to content

Commit

Permalink
Fix to cast in changes for SYS_READ. (#731)
Browse files Browse the repository at this point in the history
* Remove cast of "-1" to uint32_t.  It's now compared to a ssize_t
and the compiler should be fine with that without any cast.
  • Loading branch information
donmr authored and xor-gate committed Aug 1, 2018
1 parent 07a76b0 commit ea98ab7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gdbserver/semihosting.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ int do_semihosting (stlink_t *sl, uint32_t r0, uint32_t r1, uint32_t *ret) {
read_result = read(fd, buffer, buffer_len);
saved_errno = errno;

if (read_result == (uint32_t)-1) {
if (read_result == -1) {
*ret = buffer_len;
} else {
if (mem_write(sl, buffer_address, buffer, read_result) != 0 ) {
Expand Down

0 comments on commit ea98ab7

Please sign in to comment.