From 6239dd6abaedcfe4322770e29499ed4a05e711b8 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 27 Sep 2018 08:43:01 -0700 Subject: [PATCH] handle negative lenght in readBuffer --- sim/state/serial.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sim/state/serial.ts b/sim/state/serial.ts index ca15f894..bf7f7ed6 100644 --- a/sim/state/serial.ts +++ b/sim/state/serial.ts @@ -59,6 +59,8 @@ namespace pxsim.serial { } export function readBuffer(length: number) { + if (length <= 0) + length = 64; return pins.createBuffer(length); } } \ No newline at end of file