Fix bug with wrong port

This commit is contained in:
Jason Streifling 2024-09-11 18:14:54 +02:00
parent 391b3bf157
commit c183043dac

View File

@ -113,7 +113,10 @@ func (c *Config) handleCliArgs() error {
flag.IntVar(&port, "port", port, "port") flag.IntVar(&port, "port", port, "port")
flag.Parse() flag.Parse()
c.Port = fmt.Sprint(":", port) if port != 0 {
c.Port = fmt.Sprint(":", port)
}
c.ConfigFile, err = mkFile(c.ConfigFile, 0600, 0700) c.ConfigFile, err = mkFile(c.ConfigFile, 0600, 0700)
if err != nil { if err != nil {
return fmt.Errorf("error setting up file: %v", err) return fmt.Errorf("error setting up file: %v", err)