Cevelop / Issues

The official issue tracker for Cevelop.
9 stars 1 forks source link

Refactoring C-array into std::array uses incorrect size #105

Closed dermojo closed 5 years ago

dermojo commented 5 years ago

Expected Behavior

I'm trying to modernize the following code snippet:

char buf[100];
snprintf(buf, sizeof(buf), "Hello World");

Expecting:

std::array<char, 100> buf;
snprintf(buf.data(), buf.size(), "Hello World");

Actual Behavior

std::array<char, 100> buf;
snprintf(buf.data(), sizeof(buf.data()), "Hello World");

Cevelop Version, Operating System and Compiler

Tested on Red Hat 7 with various Cevelop versions, including the current one (1.12.0). GCC 7/8/9.

Darnor commented 5 years ago

Thanks for the report, we're looking into it.

Darnor commented 5 years ago

We've located the issue and fixed it. The fix will be available with the next release.

You could try the unstable release found under https://www.cevelop.com/cevelop/downloads/ -> cevelop-1.12.1-dev* if you want to try it out beforehand.