Skip to content

Commit be5a803

Browse files
committed
int must be initialized to 0 because it is larger than a single byte read from the serial port
1 parent e54db5e commit be5a803

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/portduino/linux/LinuxSerial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ namespace arduino {
190190
}
191191

192192
int LinuxSerial::read(void) {
193-
int buf;
193+
int buf = 0;
194194
::read(serial_port, &buf, 1);
195195
return buf;
196196
}

0 commit comments

Comments
 (0)