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:
Markus Mäkelä
2017-02-06 16:35:40 +02:00
parent 6ee257dc5f
commit c0f5124f6f

View File

@ -481,7 +481,15 @@ static const char *extract_field_name(const char* ptr, char* dest, size_t size)
if (ptr > start)
{
/** 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);
ptr = next_field_definition(ptr);