Replace spaces in username with underscores

This commit is contained in:
Trevor Slocum 2023-10-23 00:38:20 -07:00
parent cf7ac3b393
commit 508ace7b9f

View file

@ -41,7 +41,7 @@ func (c *Client) Connect() {
// Log in.
loginInfo := c.Username
if c.Username != "" && c.Password != "" {
loginInfo = fmt.Sprintf("%s %s", c.Username, strings.ReplaceAll(c.Password, " ", "_"))
loginInfo = fmt.Sprintf("%s %s", strings.ReplaceAll(c.Username, " ", "_"), strings.ReplaceAll(c.Password, " ", "_"))
}
conn.Write([]byte(fmt.Sprintf("lj bgammon-cli %s\nlist\n", loginInfo)))