summaryrefslogtreecommitdiffhomepage
path: root/Output.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-05-04 18:51:36 -0400
committerJoey Hess <joeyh@joeyh.name>2017-05-04 18:58:31 -0400
commit699687f503c63541a6e28501fa5f523b89c1915b (patch)
treef74fd9da7533b744d33bae9a714403d985047fad /Output.hs
parente8f408e6456ac445c53fe50594ee0effc136f86c (diff)
downloaddebug-me-699687f503c63541a6e28501fa5f523b89c1915b.tar.gz
sanitize gpg output and chat messages
Just in case, only allow printable characters in this, not control characters.
Diffstat (limited to 'Output.hs')
-rw-r--r--Output.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Output.hs b/Output.hs
new file mode 100644
index 0000000..5aa3072
--- /dev/null
+++ b/Output.hs
@@ -0,0 +1,10 @@
+module Output where
+
+import Data.Char
+
+sanitizeForDisplay :: String -> String
+sanitizeForDisplay = map go
+ where
+ go c
+ | isPrint c = c
+ | otherwise = '?'