Skip to content

Commit

Permalink
Fix some memory bugs caught by asan
Browse files Browse the repository at this point in the history
  • Loading branch information
TellowKrinkle committed Aug 29, 2021
1 parent fd57193 commit 5fe5b0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/PonscripterLabel_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ PonscripterLabel::drawString(const char* str, rgb_t color, Fontinfo* info,
continue;
}

if (!*str) { break; }

if (*str == 0x0a || (*str == '\\' && info->is_newline_accepted)) {
info->newLine();
str++;
Expand Down
6 changes: 3 additions & 3 deletions src/ScriptParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ class ScriptParser {
#ifdef MACOSX
void checkBundled();
bool isBundled() {return is_bundled; }
pstring bundleResPath() { return bundle_res_path; }
pstring bundleAppPath() { return bundle_app_path; }
pstring bundleAppName() { return bundle_app_name; }
const pstring& bundleResPath() { return bundle_res_path; }
const pstring& bundleAppPath() { return bundle_app_path; }
const pstring& bundleAppName() { return bundle_app_name; }
#endif

/* Command */
Expand Down

0 comments on commit 5fe5b0d

Please sign in to comment.