// Convert user_context to string as well.
std::string user_context;
if (user_context_null_ == MLM_FALSE) {
- user_context_[user_context_length_] = '\0';
- user_context.assign(user_context_);
+ user_context.assign(user_context_, user_context_length_);
}
// Set next server value (siaddr) if non NULL value returned.
// Convert it to string object for easier comparison.
std::string space;
if (space_null_ == MLM_FALSE) {
- // Typically, the string values returned by the database are not
- // NULL terminated.
- space_[space_length_] = '\0';
- space.assign(space_);
+ space.assign(space_, space_length_);
}
// If empty or null space provided, use a default top level space.
// Convert formatted_value to string.
std::string formatted_value;
if (formatted_value_null_ == MLM_FALSE) {
- formatted_value_[formatted_value_length_] = '\0';
- formatted_value.assign(formatted_value_);
+ formatted_value.assign(formatted_value_, formatted_value_length_);
}
// Convert user_context to string.
std::string user_context;
if (user_context_null_ == MLM_FALSE) {
- user_context_[user_context_length_] = '\0';
- user_context.assign(user_context_);
+ user_context.assign(user_context_, user_context_length_);
}
// Convert client classes to string.
std::string client_classes;
if (client_classes_null_ == MLM_FALSE) {
- client_classes_[client_classes_length_] = '\0';
- client_classes.assign(client_classes_);
+ client_classes.assign(client_classes_,client_classes_length_);
}
// Options are held in a binary or textual format in the database.
// Convert user_context to string as well.
std::string user_context;
if (user_context_null_ == MLM_FALSE) {
- user_context_[user_context_length_] = '\0';
- user_context.assign(user_context_);
+ user_context.assign(user_context_, user_context_length_);
}
// Set the user context if there is one.
// Convert user_context to string as well.
std::string user_context;
if (user_context_null_ == MLM_FALSE) {
- user_context_[user_context_length_] = '\0';
- user_context.assign(user_context_);
+ user_context.assign(user_context_, user_context_length_);
}
// Set the user context if there is one.