diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-03-09 21:30:54 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-03-09 21:30:54 +0100 |
commit | 604490aa96efd0cf439b962a98313dc1ca9f6eae (patch) | |
tree | 811af6353fcffdaf356eaf4e3c2e610839c4cc1a /src | |
parent | 553813b2bdac60974104b0fd9b2bd82053f14ae4 (diff) |
do not bork when receiving empty patterns
Diffstat (limited to 'src')
-rw-r--r-- | src/system.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/system.cc b/src/system.cc index 47ea436..d7d0f71 100644 --- a/src/system.cc +++ b/src/system.cc @@ -182,6 +182,12 @@ void System::receive(void) break; case META2: rxExpect = DATA_FIRSTBLOCK; + /* + * skip empty patterns (would bork because of remaining_bytes-- + * otherwise + */ + if (remaining_bytes == 0) + rxExpect = NEXT_BLOCK; break; case DATA_FIRSTBLOCK: if (remaining_bytes == 0) { |