diff options
author | LOuroboros <lunosouroboros@gmail.com> | 2022-01-12 02:32:13 -0300 |
---|---|---|
committer | LOuroboros <lunosouroboros@gmail.com> | 2022-01-12 02:32:13 -0300 |
commit | d04f9d7b1b8eab4663cfecbfcb7d6fae2c5c6eec (patch) | |
tree | 2562908a8a30e1f3e1ef12e923a1c37e5922061f | |
parent | 6ab4ff3a398fed85407373e000614b75c82bb861 (diff) |
Updated ConvertToAscii because of 13cd2a41
-rw-r--r-- | printf-in-mGBA.md | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/printf-in-mGBA.md b/printf-in-mGBA.md index 7a86d4a..2d21500 100644 --- a/printf-in-mGBA.md +++ b/printf-in-mGBA.md @@ -48,7 +48,6 @@ void StripExtCtrlCodes(u8 *str); Now we need to add the implementation of `ConvertToAscii`. Open `gflib/string_util.c`. Add `#include "malloc.h"` to the top. Then, add the following C function to the end of the file: ```c - char *ConvertToAscii(const u8 *str) { s32 i; @@ -56,11 +55,11 @@ char *ConvertToAscii(const u8 *str) for (i = 0; *str != EOS; i++, str++) { char modifiedCode = '?'; - if(*str >= CHAR_a && *str <= CHAR_z) + if (*str >= CHAR_a && *str <= CHAR_z) { modifiedCode = *str-(CHAR_a-'a'); // lower-case characters } - else if(*str >= CHAR_A && *str <= CHAR_Z) + else if (*str >= CHAR_A && *str <= CHAR_Z) { modifiedCode = *str-(CHAR_A-'A'); // upper-case characters } @@ -84,11 +83,11 @@ char *ConvertToAscii(const u8 *str) { modifiedCode = '.'; // period } - else if (*str == CHAR_DBL_QUOT_LEFT || *str == CHAR_DBL_QUOT_RIGHT) + else if (*str == CHAR_DBL_QUOTE_LEFT || *str == CHAR_DBL_QUOTE_RIGHT) { modifiedCode = '"'; // double quote } - else if (*str == CHAR_SGL_QUOT_LEFT || *str == CHAR_SGL_QUOT_RIGHT) + else if (*str == CHAR_SGL_QUOTE_LEFT || *str == CHAR_SGL_QUOTE_RIGHT) { modifiedCode = '"'; // single quote } |