I am trying to read the memory addresses from /proc//maps and I use the following code
for (ptr = NULL; getline(&ptr, &n, file) > 0;) { if (ptr
Use the 0 flag (which specifies leading zeros), followed by the padded length.
0
printf("r0: %08lx, r1: %08lx\n", r0, r1); ^^ ^^
This link is a good reference to look at.