Skip to content

CBString::format causes access violation issues #21

Description

@bajoraitisd

I wanted to use CBString::format() function in my logger implementation, but it causes access violation errors in my application (it's always in the same place, if I replace code with char[] everything works just fine).

Similar code using c-strings works just fine:

void log(const char* format, const char* arg1, const char* arg2)
{
    char buffer[2048];
    sprintf_s((char*)&buffer, sizeof(buffer), format, arg1, arg2);
    logtofile(buffer);
}

Example with CBString::format:

// this causes AV errors sometimes, don't know exactly why
void logBStrLib(const char* format, const char* arg1, const char* arg2)
{
    Bstrlib::CBString buffer;
    buffer.format(format, arg1, arg2);
    logtofile((const char*)buffer);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions