diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-01-31 07:51:07 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-01-31 07:52:23 -0500 |
| commit | e77cc2a97ff4833ca3393f97a3d549ee2db61d9b (patch) | |
| tree | 333c36e40e2ae7f9649dab5a85956b963e0e99d1 | |
| parent | 19b336d343464047eb959d1a3a2b0e08c1461c1f (diff) | |
lib: snprintf to strlcpy in frr_pthread.c
Convert to using strlcpy to erase those pesky little
gcc warnings->errors
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| -rw-r--r-- | lib/frr_pthread.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/frr_pthread.c b/lib/frr_pthread.c index fe18eb1051..d7f655271b 100644 --- a/lib/frr_pthread.c +++ b/lib/frr_pthread.c @@ -83,9 +83,9 @@ struct frr_pthread *frr_pthread_new(struct frr_pthread_attr *attr, name = (name ? name : "Anonymous thread"); fpt->name = XSTRDUP(MTYPE_FRR_PTHREAD, name); if (os_name) - snprintf(fpt->os_name, OS_THREAD_NAMELEN, "%s", os_name); + strlcpy(fpt->os_name, os_name, OS_THREAD_NAMELEN); else - snprintf(fpt->os_name, OS_THREAD_NAMELEN, "%s", name); + strlcpy(fpt->os_name, name, OS_THREAD_NAMELEN); /* initialize startup synchronization primitives */ fpt->running_cond_mtx = XCALLOC( MTYPE_PTHREAD_PRIM, sizeof(pthread_mutex_t)); |
