`chise_value_to_c_string'; use `strnlen' and `chise_value_size'
instead of `strlen'; fix problem about control characters.
if (!status)
{
unsigned char *str
- = (unsigned char *)chise_value_to_c_string (&valdatum);
- int len = strlen (str);
+ = (unsigned char *)chise_value_data (&valdatum);
+ int len = strnlen (str, chise_value_size (&valdatum));
int i = 0;
if ( (len >= 2) && (str[i++] == '?') )
if (len < 3)
return -1;
c = str[i++];
+ if (c == '^')
+ {
+ if (len < 4)
+ return -1;
+ c = str[i++];
+ if (c == '?')
+ return 0x7F;
+ else
+ return c & (0x80 | 0x1F);
+ }
}
if ( c < 0xC0 )
{