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:
|
public:
|
||||||
__ConstStringCharHolder(const char* non_null value, size_t length) : _value(new char[length + 1]) {
|
__ConstStringCharHolder(const char* non_null value, size_t length) : _value(new char[length + 1]) {
|
||||||
EnsureNotNull(value);
|
EnsureNotNull(value);
|
||||||
|
// 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 push
|
||||||
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||||
|
#endif
|
||||||
strncpy(_value, value, length);
|
strncpy(_value, value, length);
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
_value[length] = 0;
|
_value[length] = 0;
|
||||||
}
|
}
|
||||||
~__ConstStringCharHolder() noexcept { delete[] _value; }
|
~__ConstStringCharHolder() noexcept { delete[] _value; }
|
||||||
|
|
Loading…
Reference in New Issue