Thanks to visit codestin.com
Credit goes to github.com

Skip to content

serial.c:setup_baud_rate used B0 instead of expected B50  #21376

@ThomasKuehne

Description

@ThomasKuehne

in support/serial.c

if setup_baud_rate is called with baud_rate=50 and B50 was defined B0 instead of B50 is used.

reason: #endif is after break and not before break and thus the switch handling falls trough to case 0

mono/support/serial.c

Lines 272 to 285 in 1734a7d

case 50:
#ifdef B50
baud_rate = B50;
#else
baud_rate = -1;
break;
#endif
case 0:
#ifdef B0
baud_rate = B0;
#else
baud_rate = -1;
#endif
break;

On which platforms did you notice this

[ ] macOS
[X] Linux
[ ] Windows

Version Used:
Mono JIT compiler version 6.12.0.122 (tarball Sat Nov 20 13:34:48 CET 2021)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions