Skip to content

Conversation

AsparagusEduardo
Copy link
Contributor

@AsparagusEduardo AsparagusEduardo commented Aug 3, 2025

The file was mostly untouched in pokeplatinum, so most of the changes will be migrated from pokeheartgold.

Matching PR: pret/pokeheartgold#397

Copy link
Collaborator

@lhearachel lhearachel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for porting this over! Some notes below for additional context that I gleaned during review.


static void FormatDateAndLocationMet(PokemonInfoDisplayStruct *infoDisplay, int msgNo)
{
Strbuf *str = Strbuf_Init((((2 * 18) * 2) * 8), infoDisplay->heapID);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: The surrounding context implies to me that 72 ((2 * 18) * 2) is the character-allocation size for an individual template parameter within this domain. I think that it's worth listing as a constant for this source file.

Funnily, this means that the 8 here is a potential buffer-overflow that may never have been realized in the retail game.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: The surrounding context implies to me that 72 ((2 * 18) * 2) is the character-allocation size for an individual template parameter within this domain. I think that it's worth listing as a constant for this source file.

Funnily, this means that the 8 here is a potential buffer-overflow that may never have been realized in the retail game.

I haven't worked with string templates yet, so I'm unsure how this should be handled. Any recommendations?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The template itself isn't a huge deal for this specific instance, but, essentially, templates interpolate their arguments by index. They operate very similarly to, e.g. Python's formatting strings.

@AsparagusEduardo AsparagusEduardo force-pushed the pret/pr/sinjoh/trainerMemo branch from 9c94d10 to d52148d Compare August 5, 2025 01:42
@AsparagusEduardo AsparagusEduardo force-pushed the pret/pr/sinjoh/trainerMemo branch from d52148d to bd18fff Compare August 5, 2025 17:21
@AsparagusEduardo AsparagusEduardo added the pokeheartgold sync PRs to synchronize symbols with pokeheartgold; requires additional sign-off label Aug 5, 2025
Copy link
Collaborator

@lhearachel lhearachel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending approval in HG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO-NOT-MERGE pokeheartgold sync PRs to synchronize symbols with pokeheartgold; requires additional sign-off
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants