if (ip_range_len >= LNET_MAX_STR_LEN) {
snprintf(err_str,
LNET_MAX_STR_LEN,
- "\"cannot parse ip_range '%s'\"", ip_range);
+ "\"too long ip_range '%s'\"", nidstr);
err_str[LNET_MAX_STR_LEN - 1] = '\0';
rc = LUSTRE_CFG_RC_BAD_PARAM;
goto out;
if (rc != LUSTRE_CFG_RC_NO_ERR) {
snprintf(err_str,
LNET_MAX_STR_LEN,
- "\"cannot parse ip_range '%s'\"", ip_range);
+ "\"cannot parse ip_range '%.100s'\"", ip_range);
err_str[LNET_MAX_STR_LEN - 1] = '\0';
rc = LUSTRE_CFG_RC_BAD_PARAM;
goto out;
if (!entry || !entry->cy_valuestring)
continue;
- nids[num] = calloc(strlen(entry->cy_valuestring) + 1, 1);
+ nids[num] = strdup(entry->cy_valuestring);
if (!nids[num]) {
rc = LUSTRE_CFG_RC_OUT_OF_MEM;
goto failed;
}
- strncpy(nids[num], entry->cy_valuestring,
- strlen(entry->cy_valuestring));
num++;
}
rc = num;