]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/pkt.go
Use bytes.Equal() instead of bytes.Compare()==0
[nncp.git] / src / pkt.go
index a1993e7a8ed98334e2c96dc14e22cc28d73235a1..38e4659a0030f0d153e889d822ea83745abc6bf7 100644 (file)
@@ -1,6 +1,6 @@
 /*
 NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2021 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2023 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -44,6 +44,7 @@ const (
        PktTypeTrns    PktType = iota
        PktTypeExecFat PktType = iota
        PktTypeArea    PktType = iota
+       PktTypeACK     PktType = iota
 
        MaxPathSize = 1<<8 - 1
 
@@ -513,7 +514,7 @@ FullRead:
                if err != nil {
                        panic(err)
                }
-               if bytes.Compare(ct[:n], pt[:n]) != 0 {
+               if !bytes.Equal(ct[:n], pt[:n]) {
                        err = errors.New("wrong pad value")
                        return
                }