If you are converting to an unsigned, you probably want to use strtoul - either with a prefix of 0x or giving a base of 16. It is possible that strtol also works correctly, but that is supposed to give a signed value, so at the very least you may get warnings for mixing signed and unsigned from some compilers.