Fix field name parsing in avrorouter
The backtick was copied to the field name and converted to an underscore when the name was transformed into a valid Avro identifier. This caused one extra character to appear in the field name in the Avro schema files.
This commit is contained in:
@ -481,7 +481,15 @@ static const char *extract_field_name(const char* ptr, char* dest, size_t size)
|
|||||||
if (ptr > start)
|
if (ptr > start)
|
||||||
{
|
{
|
||||||
/** Valid identifier */
|
/** Valid identifier */
|
||||||
snprintf(dest, size, "%.*s", (int)(ptr - start), start);
|
size_t bytes = ptr - start;
|
||||||
|
|
||||||
|
if (bt)
|
||||||
|
{
|
||||||
|
bytes--;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(dest, start, bytes);
|
||||||
|
dest[bytes] = '\0';
|
||||||
|
|
||||||
make_valid_avro_identifier(dest);
|
make_valid_avro_identifier(dest);
|
||||||
ptr = next_field_definition(ptr);
|
ptr = next_field_definition(ptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user