Validate args to thread command

This commit is contained in:
Derek Parker
2015-03-26 13:15:35 -05:00
parent 707d55d02e
commit 0ac24abd2d
3 changed files with 53 additions and 0 deletions

View File

@ -139,6 +139,9 @@ func threads(p *proctl.DebuggedProcess, ars ...string) error {
}
func thread(p *proctl.DebuggedProcess, ars ...string) error {
if len(ars) == 0 {
return fmt.Errorf("you must specify a thread")
}
oldTid := p.CurrentThread.Id
tid, err := strconv.Atoi(ars[0])
if err != nil {