Fixes build
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
dad30a05f0
commit
64108448bc
|
@ -22,10 +22,16 @@ namespace ArbUt {
|
|||
public:
|
||||
__ConstStringCharHolder(const char* non_null value, size_t length) : _value(new char[length + 1]) {
|
||||
EnsureNotNull(value);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
// For GCC we need to disable a diagnostic that does not like this.
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
#endif
|
||||
strncpy(_value, value, length);
|
||||
#pragma GCC diagnostic pop
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
_value[length] = 0;
|
||||
}
|
||||
~__ConstStringCharHolder() noexcept { delete[] _value; }
|
||||
|
|
Loading…
Reference in New Issue