extra improvements

This commit is contained in:
Willem Van Onsem 2021-02-16 09:26:54 +01:00
parent d3a1a5576a
commit f2c58a1870
2 changed files with 2 additions and 2 deletions

View File

@ -14,4 +14,4 @@ utf8FromIso :: [Int] -> [Word8]
utf8FromIso = encode . map toEnum
ppUtf8 :: [Int] -> IO ()
ppUtf8 = print . map (($ "") . showHex) . utf8FromIso
ppUtf8 = print . map (`showHex` "") . utf8FromIso

View File

@ -137,7 +137,7 @@ readFromDevice = do
threadWaitRead fd
bytesRead <- fdReadBuf fd bufferPtr (fromIntegral maxBytes)
if bytesRead > 0
then (map $ chr . fromIntegral) <$> peekArray (fromIntegral bytesRead) bufferPtr
then map (chr . fromIntegral) <$> peekArray (fromIntegral bytesRead) bufferPtr
else return []
when (not $ null stringRep) $ logMsg $ "input bytes: " ++ show stringRep
return stringRep