Skip to content

Commit ad8739f

Browse files
Ed Wildgoosefhunleth
authored andcommitted
fix continue_in_progress_write() pointer arithmetic error
Erroneous use of the location of the pointer, rather than the pointer itself Previously, any follow on write in continue_in_progress_write() would fail with various errors, and likely include random bursts of 0s in the data stream
1 parent b4a9421 commit ad8739f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/uart_comm_unix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ static void continue_in_progress_write(struct uart *port)
677677
size_t to_write = port->write_len - port->write_offset;
678678
ssize_t written;
679679
do {
680-
written = write(port->fd, &port->write_data + port->write_offset, to_write);
680+
written = write(port->fd, (const uint8_t *)port->write_data + port->write_offset, to_write);
681681
debug("continue_in_progress_write: wrote %d/%d, errno=%d (%s)", (int) written, (int) to_write, errno, strerror(errno));
682682
} while (written < 0 && errno == EINTR);
683683

0 commit comments

Comments
 (0)