X-Git-Url: https://ruderich.org/simon/gitweb/?p=nsscash%2Fnsscash.git;a=blobdiff_plain;f=passwd.go;h=90fed68a6b9f1d959f6ab9b03e4ebf89a081ec49;hp=90351900b334b4e9154683eeb437aedff54d0b06;hb=1d028880cfb17a7c8a9e3b1f54cf1e980baca63d;hpb=c42f577140459f548b1d7b085cd4dc2717e060c6 diff --git a/passwd.go b/passwd.go index 9035190..90fed68 100644 --- a/passwd.go +++ b/passwd.go @@ -134,12 +134,7 @@ func SerializePasswd(p Passwd) []byte { res.Write(data.Bytes()) // We must pad each entry so that all uint64 at the beginning of the // struct are 8 byte aligned - l := res.Len() - if l%8 != 0 { - for i := 0; i < 8-l%8; i++ { - res.WriteByte(0) - } - } + alignBufferTo(&res, 8) return res.Bytes() }