diff options
author | dzwdz | 2022-10-19 15:17:36 +0200 |
---|---|---|
committer | dzwdz | 2022-10-19 15:17:36 +0200 |
commit | e4118bb67dee6b4064d196cbe6e1c83cb7d1d586 (patch) | |
tree | c19eae356e2437d779af176c855a4a2a0587ea26 /src/user/app/testelf/main.c | |
parent | d98c6dd0954bd753a9150d39364f3866579cf2f0 (diff) |
shared/printf: implement %p
Diffstat (limited to 'src/user/app/testelf/main.c')
-rw-r--r-- | src/user/app/testelf/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/user/app/testelf/main.c b/src/user/app/testelf/main.c index ea97b4a..5608cc7 100644 --- a/src/user/app/testelf/main.c +++ b/src/user/app/testelf/main.c @@ -5,11 +5,11 @@ const char *str = "Hello!", *str2 = "World."; int main(int argc, char **argv) { - printf("elftest's &main == 0x%x\n", &main); + printf("elftest's &main == %p\n", &main); printf("%s %s\n", str, str2); printf("argc == %u\n", argc); for (int i = 0; i < argc; i++) - printf("argv[%u] == 0x%x == \"%s\"\n", i, argv[i], argv[i]); + printf("argv[%u] == %p == \"%s\"\n", i, argv[i], argv[i]); if (strcmp(argv[1], "stackexec") == 0) { /* exec something with arguments on the stack */ const char s_d[] = "I am a pretty long string on the stack. Oh my. " \ @@ -17,7 +17,7 @@ int main(int argc, char **argv) { char s[sizeof(s_d)]; memcpy(s, s_d, sizeof(s_d)); const char *argv2[] = {argv[0], s, s, "hello", s, s, s, "lol", NULL}; - printf("argv2 == 0x%x, s == 0x%x\n== exec ==\n", argv2, s); + printf("argv2 == %p, s == %p\n== exec ==\n", argv2, s); execv(argv[0], (void*)argv2); puts("stackexec failed"); } |