- Report an error if reading a tarval string with unappropriate characters
for the base indicated by the base prefix
- Use "0x" prefix, when writing irms_int_number native (hex) values.
[r25594]
case 'c':
case 'b':
case 'a':
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
val[0] = _digit((*str)-'a'+10);
}
else
case 'C':
case 'B':
case 'A':
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
val[0] = _digit((*str)-'A'+10);
}
else
- 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
val[0] = _digit((*str)-'0');
}
else
/* last nibble must be masked */
if (bits & 3) {
/* 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)];
}
x = and_table[_val(val[counter++])][mask];
*(--pos) = digits[_val(x)];
}
/* last nibble must be masked */
if (bits & 3) {
/* 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;
x = and_table[_val(val[counter++])][mask];
pos -= 4;
/* last nibble must be masked */
if (bits & 3) {
/* 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;
}
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;
str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_OCT, 0);
break;
+ prefix = "0x";
+ case TVO_HEX:
default:
str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_HEX, 0);
break;
default:
str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_HEX, 0);
break;