]> ruderich.org/simon Gitweb - nsscash/nsscash.git/commitdiff
nsscash: use WriteByte() instead of Write() with cast
authorSimon Ruderich <simon@ruderich.org>
Sat, 8 Jun 2019 13:50:34 +0000 (15:50 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sat, 8 Jun 2019 13:50:34 +0000 (15:50 +0200)
Less to type and easier to read.

The old solution used '0' to pad instead 0. This isn't an issue as these
bytes are not used. But fix it as well.

passwd.go

index 1b4939c63ac6a1a9b2c634bdd0a74a2def5f0419..90351900b334b4e9154683eeb437aedff54d0b06 100644 (file)
--- a/passwd.go
+++ b/passwd.go
@@ -137,7 +137,7 @@ func SerializePasswd(p Passwd) []byte {
        l := res.Len()
        if l%8 != 0 {
                for i := 0; i < 8-l%8; i++ {
-                       res.Write([]byte{'0'})
+                       res.WriteByte(0)
                }
        }