Skip to content

setConsoleTitle strings #50

@MangaD

Description

@MangaD

There is a problem with the setConsoleTitle function. It uses const char * as string parameter for the print function when compiling with C++. This seems to be a problem because when compiling with clang++ and with the flag -fsanitizer=memory, I just get a warning about uninitialized value at the line:
RLUTIL_PRINT(true_title);

So, I'd advise to change the code of that function to:

RLUTIL_INLINE void setConsoleTitle(RLUTIL_STRING_T title) { #if defined(_WIN32) && !defined(RLUTIL_USE_ANSI) #ifdef __cplusplus SetConsoleTitleA(title.c_str()); #else SetConsoleTitleA(title); #endif #else RLUTIL_PRINT(ANSI_CONSOLE_TITLE_PRE); RLUTIL_PRINT(title); RLUTIL_PRINT(ANSI_CONSOLE_TITLE_POST); #endif // defined(_WIN32) && !defined(RLUTIL_USE_ANSI) } 

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