johndoe31415 / luksipc

Official master repository of the LUKS in-place-conversion utility (luksipc)
GNU General Public License v3.0
91 stars 12 forks source link

Fix formatting for non-native 64bit values #9

Closed nopjmp closed 8 years ago

nopjmp commented 8 years ago

PRIu64 is a macro to select the appropriate type for the platform.

I found this while using systemrescuecd-x86-4.8.0.iso to convert my laptop over. Luckily nothing broke on my machine when using it without this.

The printf state gets corrupted and subsequent values get corrupted. It caused the rawDevice pointer to be "(null)" and fail the startup process.

johndoe31415 commented 8 years ago

Very good one, merged to master. There's some occurences left in there ("%7lu" in luksipc.c), I'll see how these can be fixed. Thanks for testing on x86-32.

nopjmp commented 8 years ago

All you really need to do is "%7" PRIu64 " PRIu64 is just a macro for llu or lu depending on how uint64_t is defined.

johndoe31415 commented 8 years ago

Yes of course, I for some reason thought the macro already included the % character. Yup, then I think they're all converted now. Just one question, when you compiled for x86-32, did gcc show warning for these instances? It really should have, but I'm not certain. It's been a long time since I last worked on a x86-32 machine...