Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logical error in text.tact #603 #1

Closed
wants to merge 1 commit into from
Closed

Conversation

Srg-12
Copy link
Owner

@Srg-12 Srg-12 commented Jul 22, 2024

The fromBase64 function contains a logical error in the if conditions used to check for specific characters. Instead of using the logical AND operator &&, the code uses the "||" to combine conditions. This will result in a syntax error.

Original:
} else if (code == 45 || code == 43) { // - or +
result = result.storeUint(62, 6);
} else if (code == 95 || code == 47) { // _ or /

Improved:
} else if (code == 45 && code == 43) { // - or +
result = result.storeUint(62, 6);
} else if (code == 95 && code == 47) { // _ or /

Closes tact-lang#603

  • I have updated CHANGELOG.md
  • I have documented my contribution in Tact Docs: https://github.com/tact-lang/tact-docs/pull/PR-NUMBER
  • I have added tests to demonstrate the contribution is correctly implemented: this usually includes both positive and negative tests, showing the happy path(s) and featuring intentionally broken cases
  • I have run all the tests locally and no test failure was reported
  • I have run the linter, formatter and spellchecker
  • I did not do unrelated and/or undiscussed refactorings

TON Wallet: UQCi49NtqN9j0k8xciv0TzX8MR2NC6I7G1ABdzVMdLrpRG1s

Edited:
Line tact-lang#74 From:
 } else if (code == 45 || code == 43) { // - or +
To:
 } else if (code == 45 && code == 43) { // - or +

Line tact-lang#76 From:
} else if (code == 95 || code == 47) { // _ or /
} else if (code == 95 && code == 47) { // _ or /
@Srg-12 Srg-12 closed this Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logical error in text.tact
1 participant