2 Commits

Author SHA1 Message Date
oracle a7183cd560 hotfix -> fixed Atoi bug and quote OOB error 2026-09-12 23:26:39 -04:00
oracle bba0bc1a29 Merge branch 'qol' 2026-09-06 15:07:41 -04:00
+7 -3
View File
@@ -52,7 +52,11 @@
// 05-12-2026: added v and vv input flags // 05-12-2026: added v and vv input flags
// 09-05-2026: buncha shit happened, dropped the commit // 09-05-2026: buncha shit happened, dropped the commit
//#09-06-2026: added /e1/, /e2/, and /cr/, got edit working //#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 package main
@@ -195,7 +199,7 @@ func handle( command []string ) string {
case "qr": // /qr/, quote request case "qr": // /qr/, quote request
// convert message argument to string to make sure it's a // convert message argument to string to make sure it's a
// valid number // 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 // nerr will not be nil if comm[1] is not a number
if nerr != nil { if nerr != nil {
// formulate an error message // formulate an error message
@@ -213,7 +217,7 @@ func handle( command []string ) string {
// why bad? num is - // why bad? num is -
default: default:
// good num, get quote, send off // good num, get quote, send off
resp = "qa@" + qlist[num - 1] // quote answer resp = "qa@" + qlist[num] // quote answer
} }
} }
case "lr": // /lr/, list request case "lr": // /lr/, list request