From 24976315d4f168a6e2e2ef5b677d02f207d5e23e Mon Sep 17 00:00:00 2001 From: Spotlight Date: Wed, 6 Jul 2022 11:51:01 -0500 Subject: [PATCH] Ensure title ID is lowercase --- ecs.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ecs.go b/ecs.go index 8f3753e..ca4382b 100644 --- a/ecs.go +++ b/ecs.go @@ -22,6 +22,7 @@ import ( "fmt" "github.com/wii-tools/wadlib" "log" + "strings" ) const ( @@ -121,6 +122,9 @@ func purchaseTitle(e *Envelope) { return } + // We store title IDs in lowercase. + titleId = strings.ToLower(titleId) + // Query the ticket and current version for this title. var ticket []byte var version int @@ -131,6 +135,7 @@ func purchaseTitle(e *Envelope) { log.Printf("unexpected error purchasing: %v", err) // TODO(spotlightishere): Can we more elegantly return an error when a title may not exist here? e.Error(2, "error purchasing", nil) + return } // Associate the given title ID with the user.