Skip to content

imagebld: Fix parameters in printf calls#14

Merged
JayFoxRox merged 1 commit intoXboxDev:masterfrom
binarymaster:imagebld
Oct 10, 2019
Merged

imagebld: Fix parameters in printf calls#14
JayFoxRox merged 1 commit intoXboxDev:masterfrom
binarymaster:imagebld

Conversation

@binarymaster
Copy link
Copy Markdown
Contributor

Fixes #8.

@JayFoxRox
Copy link
Copy Markdown
Member

JayFoxRox commented Oct 10, 2019

Amazingly, the old code still worked fine for me, because the argument remains on stack (in register?) with my default compiler setup. Not even valgrind will complain.

Anyhow, new version should be more stable.

For the future, we should consider adding -Wall; which also warns about another case which might cause imagebld to misbehave:

lib/imagebld/imagebld.c:148:28: warning: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
  148 |      memset(xbe,0x00,sizeof(xbe));
      |                            ^

@JayFoxRox JayFoxRox merged commit 6c37770 into XboxDev:master Oct 10, 2019
@binarymaster binarymaster deleted the imagebld branch October 10, 2019 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add parameter to printf calls in imagebld

2 participants