#include <sys/mman.h>
#include <rte_log.h>
+#include <rte_string_fns.h>
#include <ctx.h>
#include <stack.h>
{
struct lthread *lt = THIS_LTHREAD;
- strncpy(lt->funcname, f, sizeof(lt->funcname));
- lt->funcname[sizeof(lt->funcname)-1] = 0;
+ strlcpy(lt->funcname, f, sizeof(lt->funcname));
}
#include <rte_log.h>
#include <rte_common.h>
+#include <rte_string_fns.h>
#include "lthread_api.h"
#include "lthread_diag_api.h"
}
if (name == NULL)
- strncpy(c->name, "no name", sizeof(c->name));
+ strlcpy(c->name, "no name", sizeof(c->name));
else
- strncpy(c->name, name, sizeof(c->name));
- c->name[sizeof(c->name)-1] = 0;
+ strlcpy(c->name, name, sizeof(c->name));
c->root_sched = THIS_SCHED;
#include <rte_log.h>
#include <rte_spinlock.h>
#include <rte_common.h>
+#include <rte_string_fns.h>
#include "lthread_api.h"
#include "lthread_int.h"
}
if (name == NULL)
- strncpy(m->name, "no name", sizeof(m->name));
+ strlcpy(m->name, "no name", sizeof(m->name));
else
- strncpy(m->name, name, sizeof(m->name));
- m->name[sizeof(m->name)-1] = 0;
+ strlcpy(m->name, name, sizeof(m->name));
m->root_sched = THIS_SCHED;
m->owner = NULL;