Commit e14da610 authored by Rafaël Carré's avatar Rafaël Carré

CC: simplify Eia608TextUtf8()

parent d3a8a23d
......@@ -899,23 +899,14 @@ static void Eia608TextUtf8( char *psz_utf8, uint8_t c ) // Returns number of byt
#undef E2
#undef E1
static const int i_c2utf8 = sizeof(c2utf8)/sizeof(*c2utf8);
int i;
for( i = 0; i < i_c2utf8; i++ )
{
if( c2utf8[i].c == c )
break;
for( size_t i = 0; i < ARRAY_SIZE(c2utf8) ; i++ )
if( c2utf8[i].c == c ) {
strcpy( psz_utf8, c2utf8[i].utf8 );
return;
}
if( i >= i_c2utf8 )
{
psz_utf8[0] = c < 0x80 ? c : '?'; /* Normal : Unsupported */
psz_utf8[1] = '\0';
}
else
{
strcpy( psz_utf8, c2utf8[i].utf8 );
}
}
static void Eia608Strlcat( char *d, const char *s, int i_max )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment