if ( ! Kumu::read_BER(buf + SMPTE_UL_LENGTH, &tmp_size) )
return RESULT_FAIL;
- m_ValueLength = tmp_size;
+ assert (tmp_size <= 0xFFFFFFFFL);
+ m_ValueLength = (ui32_t) tmp_size;
m_KLLength = SMPTE_UL_LENGTH + Kumu::BER_length(buf + SMPTE_UL_LENGTH);
m_KeyStart = buf;
m_ValueStart = buf + m_KLLength;
if ( m_KeyStart != 0 )
{
assert(m_ValueStart);
-
- for ( ui32_t i = 0; i < SMPTE_UL_LENGTH; i++ )
- fprintf(stream, "%02x.", m_KeyStart[i]);
+ UL TmpUL(m_KeyStart);
+ char buf[64];
+ fprintf(stream, "%s", TmpUL.EncodeString(buf, 64));
const MDDEntry* Entry = Dict::FindUL(m_KeyStart);
- fprintf(stream, "\b len: %7lu (%s)\n", m_ValueLength, (Entry ? Entry->name : "Unknown"));
+ fprintf(stream, " len: %7u (%s)\n", m_ValueLength, (Entry ? Entry->name : "Unknown"));
if ( show_hex && m_ValueLength < 1000 )
Kumu::hexdump(m_ValueStart, Kumu::xmin(m_ValueLength, (ui32_t)64), stream);
if ( read_count < (SMPTE_UL_LENGTH + 1) )
{
- DefaultLogSink().Error("Short read of Key and Length got %lu\n", read_count);
+ DefaultLogSink().Error("Short read of Key and Length got %u\n", read_count);
return RESULT_READFAIL;
}
ui32_t remainder = 0;
ui32_t ber_len = Kumu::BER_length(tmp_data + SMPTE_UL_LENGTH);
m_KLLength = SMPTE_UL_LENGTH + ber_len;
- m_ValueLength = tmp_size;
+ assert(tmp_size <= 0xFFFFFFFFL);
+ m_ValueLength = (ui32_t) tmp_size;
ui32_t packet_length = m_ValueLength + m_KLLength;
result = m_Buffer.Capacity(packet_length);
{
if ( read_count < tmp_read_size )
{
- DefaultLogSink().Error("Short read of packet body, expecting %lu, got %lu\n",
+ DefaultLogSink().Error("Short read of packet body, expecting %u, got %u\n",
m_Buffer.Size(), read_count);
return RESULT_READFAIL;
}
if ( read_count != remainder )
{
- DefaultLogSink().Error("Short read of packet body, expecting %lu, got %lu\n",
+ DefaultLogSink().Error("Short read of packet body, expecting %u, got %u\n",
remainder+tmp_read_size, read_count+tmp_read_size);
result = RESULT_READFAIL;
}