Skip to content

Commit

Permalink
Use C++ default constructor to init termios structure
Browse files Browse the repository at this point in the history
  • Loading branch information
teemuatlut committed Oct 4, 2021
1 parent 1698425 commit 80c01e7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/source/bcm2835_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ void Stream::begin(unsigned long baud, int flags)
return;
}

// https://stackoverflow.com/questions/61531928/why-doesnt-initializing-a-c-struct-to-0-set-all-of-its-members-to-0
struct termios options;
memset( &options, 0, sizeof(options) );
termios options{};

tcgetattr(fd, &options);

Expand Down

0 comments on commit 80c01e7

Please sign in to comment.