diff --git a/pkg/usaddress/fuzz_test.go b/pkg/usaddress/fuzz_test.go index ab017dab..e020bd70 100644 --- a/pkg/usaddress/fuzz_test.go +++ b/pkg/usaddress/fuzz_test.go @@ -23,6 +23,7 @@ func FuzzStandardizeAddress(f *testing.F) { " \n \t", "!@#$%^&*()_+", "C/O Jane Smith\n123 Unknown Rd\nMystery, ZZ 99999", + "TX 00000", } // Add the corpus entries to the fuzzer diff --git a/pkg/usaddress/usaddress.go b/pkg/usaddress/usaddress.go index 1053a81e..480e55a2 100644 --- a/pkg/usaddress/usaddress.go +++ b/pkg/usaddress/usaddress.go @@ -218,7 +218,7 @@ func StandardizeAddress(addressStr string) Address { } } - if stateIndex >= 0 { + if stateIndex > 0 { // Found state pattern, split accordingly deliveryLine := strings.Join(words[:stateIndex-1], " ") // Everything before city lastLine = strings.Join(words[stateIndex-1:], " ") // City and onwards