2
0
forked from drew/smtprelay

smtp: fix calls to Printf(s) with non constant format

Merge from net/smtp/smtp.go

Obtained from:	bf91eb3a8bb057a620f3823e4d6b74a529c0a44d
This commit is contained in:
Bernhard Froehlich
2025-06-04 18:05:52 +00:00
parent 68ddb8cbc0
commit 2753d3670d

View File

@@ -207,7 +207,7 @@ func (c *Client) Auth(a smtp.Auth) error {
} }
resp64 := make([]byte, encoding.EncodedLen(len(resp))) resp64 := make([]byte, encoding.EncodedLen(len(resp)))
encoding.Encode(resp64, resp) encoding.Encode(resp64, resp)
code, msg64, err := c.cmd(0, strings.TrimSpace(fmt.Sprintf("AUTH %s %s", mech, resp64))) code, msg64, err := c.cmd(0, "%s", strings.TrimSpace(fmt.Sprintf("AUTH %s %s", mech, resp64)))
for err == nil { for err == nil {
var msg []byte var msg []byte
switch code { switch code {
@@ -233,7 +233,7 @@ func (c *Client) Auth(a smtp.Auth) error {
} }
resp64 = make([]byte, encoding.EncodedLen(len(resp))) resp64 = make([]byte, encoding.EncodedLen(len(resp)))
encoding.Encode(resp64, resp) encoding.Encode(resp64, resp)
code, msg64, err = c.cmd(0, string(resp64)) code, msg64, err = c.cmd(0, "%s", resp64)
} }
return err return err
} }