-
Notifications
You must be signed in to change notification settings - Fork 138
Synced Trainer Memo file with pokeheartgold #665
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
base: main
Are you sure you want to change the base?
Synced Trainer Memo file with pokeheartgold #665
Conversation
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
9c94d10
to
d52148d
Compare
d52148d
to
bd18fff
Compare
There was a problem hiding this 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.
The file was mostly untouched in pokeplatinum, so most of the changes will be migrated from pokeheartgold.
Matching PR: pret/pokeheartgold#397