fix args checking for chpass. from ptd
Ted Unangst tedu@tedunangst.com
Tue, 22 Nov 2022 13:06:57 -0500
M
util.go
→
util.go
@@ -255,12 +255,8 @@ doordie(db, "delete from auth where userid = ?", userid)
doordie(db, "delete from users where userid = ?", userid) } -func chpass() { - if len(os.Args) < 3 { - fmt.Printf("need a username\n") - os.Exit(1) - } - user, err := butwhatabout(os.Args[2]) +func chpass(username string) { + user, err := butwhatabout(username) if err != nil { elog.Fatal(err) }