Skip to content

Kumu::Timestamp::EncodeString usage comment in KM_util.h is incorrect #162

@dcbullock

Description

@dcbullock

The EncodeString method on Kumu::Timestamp requires a buffer length of Kumu::DateTimeLen+1 or greater, not Kumu::DateTimeLen or greater. The comment in KM_util.h is inconsistent with KM_util.cpp.

KM_util.h

// Write the timestamp value to the given buffer in the form 2004-05-01T13:20:00+00:00
// returns 0 if the buffer is smaller than DateTimeLen
const char* EncodeString(char* str_buf, ui32_t buf_len) const;

KM_util.cpp

// 
const char*
Kumu::Timestamp::EncodeString(char* str_buf, ui32_t buf_len) const
{
  if ( buf_len < ( DateTimeLen + 1 ) )
    return 0;

  ui16_t year;
  ui8_t month, day, hour, minute, second;

// ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions