Do not require prefix for hex

This commit is contained in:
Jeremy Soller
2018-10-16 18:03:21 -06:00
parent 460f57b37f
commit 3c2121d4e0
3 changed files with 3 additions and 1 deletions
+1
View File
@@ -13,6 +13,7 @@ int main(int argc, char* argv[]) {
printf("%lx\n", strtol(" 0x38Acfg", NULL, 0));
printf("%lx\n", strtol("0Xabcdef12", NULL, 16));
printf("%lx\n", strtol("cafebeef", NULL, 16));
printf("%lo\n", strtol(" 073189", NULL, 0));
printf("%lo\n", strtol(" 073189", NULL, 8));