[systemd-devel] How to handle untagged hexvalues in systemd code?

Olaf Hering olaf at aepfle.de
Mon Jan 15 17:44:41 UTC 2018


I submitted a correct and tested patch via https://github.com/systemd/systemd/pull/7581, which was using sscanf("0028f0", "%x",&val). During discussion I was soft-forced to use systemd helper functions. These (strtoull based) helpers expect "0x...", which sysfs does not provide. As a result 575e658 is broken. My fault, I did not doublecheck the updated submission...

So, how is one supposed to handle untagged hexvalues? Invent a new helper, or prepend "0x" if missing, or just use sscanf?

Olaf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: Digitale Signatur von OpenPGP
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180115/411d4ff3/attachment.sig>


More information about the systemd-devel mailing list