From 9a93ae6370a502ee2c9d08b67f057c53216ca99e Mon Sep 17 00:00:00 2001 From: x_123 Date: Wed, 16 Oct 2024 13:01:49 +0800 Subject: [PATCH 1/2] Fix Corrected improper use of `reader` and `bReader` --- experimental/libbox/profile_import.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/libbox/profile_import.go b/experimental/libbox/profile_import.go index 258c175a9f..61cadc582e 100644 --- a/experimental/libbox/profile_import.go +++ b/experimental/libbox/profile_import.go @@ -218,7 +218,7 @@ func DecodeProfileContent(data []byte) (*ProfileContent, error) { if err != nil { return nil, err } - err = binary.Read(reader, binary.BigEndian, &content.Type) + err = binary.Read(bReader, binary.BigEndian, &content.Type) if err != nil { return nil, err } From d47344d65db5cf84b5895b0c258dc4d52edf881d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 16 Oct 2024 20:39:23 +0800 Subject: [PATCH 2/2] fix --- experimental/libbox/profile_import.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/experimental/libbox/profile_import.go b/experimental/libbox/profile_import.go index 61cadc582e..17671e560f 100644 --- a/experimental/libbox/profile_import.go +++ b/experimental/libbox/profile_import.go @@ -233,17 +233,17 @@ func DecodeProfileContent(data []byte) (*ProfileContent, error) { } } if content.Type == ProfileTypeRemote || (version == 0 && content.Type != ProfileTypeLocal) { - err = binary.Read(reader, binary.BigEndian, &content.AutoUpdate) + err = binary.Read(bReader, binary.BigEndian, &content.AutoUpdate) if err != nil { return nil, err } if version >= 1 { - err = binary.Read(reader, binary.BigEndian, &content.AutoUpdateInterval) + err = binary.Read(bReader, binary.BigEndian, &content.AutoUpdateInterval) if err != nil { return nil, err } } - err = binary.Read(reader, binary.BigEndian, &content.LastUpdated) + err = binary.Read(bReader, binary.BigEndian, &content.LastUpdated) if err != nil { return nil, err }