From fab556994c2127663253a2d14d379d35dc09b981 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Sun, 8 Jun 2025 03:36:44 -0400 Subject: fig-bus: Fix binary bus to properly support 0-length data --- fig-bus/src/Fig/Bus/Binary/Utils.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fig-bus/src/Fig') diff --git a/fig-bus/src/Fig/Bus/Binary/Utils.hs b/fig-bus/src/Fig/Bus/Binary/Utils.hs index 2fa714d..a270fcc 100644 --- a/fig-bus/src/Fig/Bus/Binary/Utils.hs +++ b/fig-bus/src/Fig/Bus/Binary/Utils.hs @@ -18,7 +18,7 @@ readLengthPrefixed :: Handle -> IO (Maybe ByteString) readLengthPrefixed h = do n <- hGet h 4 case intFromLEBytes (BS.unpack n) of - 0 -> pure Nothing + 0 -> pure $ Just "" len -> do x <- hGet h len pure $ Just x -- cgit v1.2.3