mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-02 15:05:16 +00:00
[#1266] fixed compilation
This commit is contained in:
@@ -81,8 +81,7 @@ class InterprocessSync;
|
|||||||
/// the string passed to the Logger constructor) to a maximum of 31 characters.
|
/// the string passed to the Logger constructor) to a maximum of 31 characters.
|
||||||
/// There is no reason for this particular value other than limiting the amount
|
/// There is no reason for this particular value other than limiting the amount
|
||||||
/// of memory used. It is defined by the constant Logger::MAX_LOGGER_NAME_SIZE,
|
/// of memory used. It is defined by the constant Logger::MAX_LOGGER_NAME_SIZE,
|
||||||
/// and can be made larger (or smaller) if so desired. Note however, using a
|
/// and can be made larger (or smaller) if so desired.
|
||||||
/// logger name larger than this limit will cause an assertion failure.
|
|
||||||
|
|
||||||
class LoggerImpl; // Forward declaration of the implementation class
|
class LoggerImpl; // Forward declaration of the implementation class
|
||||||
|
|
||||||
@@ -178,12 +177,6 @@ public:
|
|||||||
isc_throw(LoggerNameNull, "logger names may not be null");
|
isc_throw(LoggerNameNull, "logger names may not be null");
|
||||||
}
|
}
|
||||||
|
|
||||||
// The checks above and the assertion below ensure that the contents of
|
|
||||||
// "name" plus a trailing null will fit into the space allocated for
|
|
||||||
// "name_".
|
|
||||||
static_assert(MAX_LOGGER_NAME_SIZE < sizeof(name_), "name size too small");
|
|
||||||
|
|
||||||
|
|
||||||
// Do the copy, ensuring a trailing null in all cases.
|
// Do the copy, ensuring a trailing null in all cases.
|
||||||
std::strncpy(name_, name, MAX_LOGGER_NAME_SIZE);
|
std::strncpy(name_, name, MAX_LOGGER_NAME_SIZE);
|
||||||
name_[MAX_LOGGER_NAME_SIZE] = '\0';
|
name_[MAX_LOGGER_NAME_SIZE] = '\0';
|
||||||
|
Reference in New Issue
Block a user