Skip to content
Snippets Groups Projects
Commit b0b81690 authored by Tim Wickberg's avatar Tim Wickberg
Browse files

Start strncpy -> strlcpy cleanup.

strlcpy ensures strings are terminated with \0 properly.
parent 1673cba4
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,7 @@
#include <unistd.h>
#include "slurm/slurm.h"
#include "src/srun/libsrun/launch.h"
#include "src/common/strlcpy.h"
#include "src/common/switch.h"
#include "src/common/slurm_protocol_api.h"
#include "src/common/xmalloc.h"
......@@ -84,7 +85,7 @@ enqueue_nag_req(int fd, int rank, char *key)
req = xmalloc(sizeof(nag_req_t));
req->fd = fd;
req->rank = rank;
strncpy(req->key, key, (PMI2_MAX_KEYLEN - 1)); /* Insure NULL at end */
strlcpy(req->key, key, PMI2_MAX_KEYLEN);
/* insert in the head */
req->next = nag_req_list;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment