diff --git a/server.go b/server.go index 7a81405..212e71f 100644 --- a/server.go +++ b/server.go @@ -52,7 +52,11 @@ // 05-12-2026: added v and vv input flags // 09-05-2026: buncha shit happened, dropped the commit //#09-06-2026: added /e1/, /e2/, and /cr/, got edit working -// +//H09-12-2026: minor comments in receive() +// hotfix -> accidentally trying to Atoi the command +// instead of the argument +// hotfix -> subtracting 1 from int before getting quote +// from list // ============================================================================= package main @@ -195,7 +199,7 @@ func handle( command []string ) string { case "qr": // /qr/, quote request // convert message argument to string to make sure it's a // valid number - num, nerr := strconv.Atoi( command[0] ) + num, nerr := strconv.Atoi( command[1] ) // nerr will not be nil if comm[1] is not a number if nerr != nil { // formulate an error message @@ -213,7 +217,7 @@ func handle( command []string ) string { // why bad? num is - default: // good num, get quote, send off - resp = "qa@" + qlist[num - 1] // quote answer + resp = "qa@" + qlist[num] // quote answer } } case "lr": // /lr/, list request