* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2014, 2016, Intel Corporation.
+ * Copyright (c) 2014, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
nl_oom();
s[0] = '\0';
for (i = 0; i < nl->count; i++) {
- if (i > 0)
- strncat(s, sep, len);
- strncat(s, nl->nids[i], len);
+ int cur = strlen(s);
+ snprintf(s + cur, len - cur, "%s%s",
+ i > 0 ? sep : "", nl->nids[i]);
}
return s;
}
"-%s", savedn);
free(savedn);
}
- strncat(s, "]", 1);
+ strncat(s, "]", max_len - strlen(s));
if (lnet)
snprintf(s + strlen(s), max_len - strlen(s),
"@%s", lnet);