From d1e448cfa5a2c87de9a22f8717478a9c54bdda99 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 30 Jan 2021 14:00:29 -0500 Subject: lib: update StripSpaceChars strip 'NUL' character too. --- lib/str.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/str.go') diff --git a/lib/str.go b/lib/str.go index 6ba9507..bc25e2d 100644 --- a/lib/str.go +++ b/lib/str.go @@ -51,6 +51,9 @@ func StripSpaceChars(s string) string { if s[i] == '\n' { continue } + if s[i] == 0 { // NUL character + continue + } ss += string(s[i]) } return ss -- cgit v1.2.3