Skip to content

Commit fd20b0f

Browse files
amxfonsecagsigh
authored andcommitted
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.
1 parent 323881f commit fd20b0f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

serialport.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ SP_API enum sp_return sp_blocking_write(struct sp_port *port, const void *buf,
886886
unsigned char *ptr = (unsigned char *) buf;
887887
struct timeout timeout;
888888
fd_set fds;
889-
int result;
889+
ssize_t result;
890890

891891
timeout_start(&timeout, timeout_ms);
892892

@@ -1091,7 +1091,7 @@ SP_API enum sp_return sp_blocking_read(struct sp_port *port, void *buf,
10911091
unsigned char *ptr = (unsigned char *) buf;
10921092
struct timeout timeout;
10931093
fd_set fds;
1094-
int result;
1094+
ssize_t result;
10951095

10961096
timeout_start(&timeout, timeout_ms);
10971097

@@ -1214,7 +1214,7 @@ SP_API enum sp_return sp_blocking_read_next(struct sp_port *port, void *buf,
12141214
size_t bytes_read = 0;
12151215
struct timeout timeout;
12161216
fd_set fds;
1217-
int result;
1217+
ssize_t result;
12181218

12191219
timeout_start(&timeout, timeout_ms);
12201220

0 commit comments

Comments
 (0)