From fd20b0fc5a34cd7f776e4af6c763f59041de223b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fonseca?= Date: Tue, 29 Aug 2023 10:11:10 +0200 Subject: [PATCH] change type of result variables to ssize_t These variables are being used to store the result of read/write calls, which return a ssize_t value, which depending on platform can be bigger than an int. --- serialport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/serialport.c b/serialport.c index e6097ee..1b5a95e 100644 --- a/serialport.c +++ b/serialport.c @@ -886,7 +886,7 @@ SP_API enum sp_return sp_blocking_write(struct sp_port *port, const void *buf, unsigned char *ptr = (unsigned char *) buf; struct timeout timeout; fd_set fds; - int result; + ssize_t result; timeout_start(&timeout, timeout_ms); @@ -1091,7 +1091,7 @@ SP_API enum sp_return sp_blocking_read(struct sp_port *port, void *buf, unsigned char *ptr = (unsigned char *) buf; struct timeout timeout; fd_set fds; - int result; + ssize_t result; timeout_start(&timeout, timeout_ms); @@ -1214,7 +1214,7 @@ SP_API enum sp_return sp_blocking_read_next(struct sp_port *port, void *buf, size_t bytes_read = 0; struct timeout timeout; fd_set fds; - int result; + ssize_t result; timeout_start(&timeout, timeout_ms);