case 'c':
case 'b':
case 'a':
- if (base[0] > SC_9 || base[1] > SC_0) { /* (base > 10) */
+ if (base[0] > SC_A || base[1] > SC_0) { /* (base > 10) */
val[0] = _digit((*str)-'a'+10);
}
else
case 'C':
case 'B':
case 'A':
- if (base[0] > SC_9 || base[1] > SC_0) { /* (base > 10) */
+ if (base[0] > SC_A || base[1] > SC_0) { /* (base > 10) */
val[0] = _digit((*str)-'A'+10);
}
else
case '9':
case '8':
- if (base[0] > SC_7 || base[1] > SC_0) { /* (base > 8) */
+ if (base[0] > SC_8 || base[1] > SC_0) { /* (base > 8) */
val[0] = _digit((*str)-'0');
}
else
/* last nibble must be masked */
if (bits & 3) {
- mask = zex_digit[bits & 3];
+ mask = zex_digit[(bits & 3) - 1];
x = and_table[_val(val[counter++])][mask];
*(--pos) = digits[_val(x)];
}
/* last nibble must be masked */
if (bits & 3) {
- mask = zex_digit[bits & 3];
+ mask = zex_digit[(bits & 3) - 1];
x = and_table[_val(val[counter++])][mask];
pos -= 4;
/* last nibble must be masked */
if (bits & 3) {
- mask = zex_digit[bits & 3];
+ mask = zex_digit[(bits & 3) - 1];
div1_res[counter] = and_table[_val(p[counter])][mask];
++counter;
}
str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_OCT, 0);
break;
- case TVO_HEX:
case TVO_NATIVE:
+ prefix = "0x";
+ case TVO_HEX:
default:
str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_HEX, 0);
break;