diff options
| author | LLLL Colonq <llll@colonq> | 2025-06-08 03:36:44 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2025-06-08 03:36:44 -0400 |
| commit | fab556994c2127663253a2d14d379d35dc09b981 (patch) | |
| tree | 83f98f4a61101acb42fb8a8daf9f3c393a22e704 | |
| parent | 53f00efe6034d03fd383c90c032c50d69e145d61 (diff) | |
fig-bus: Fix binary bus to properly support 0-length data
| -rw-r--r-- | fig-bus/src/Fig/Bus/Binary/Utils.hs | 2 |
1 files changed, 1 insertions, 1 deletions
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 |
