X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fcmdline%2Fcommands.c;h=4badffc2578d39ab0c8a3caa26a29ed6feed05db;hb=c621a9b66bd24e363645b68f08b6f3ef7ab430cc;hp=06916d7832c7f8d74973c6a977c7cdb3ce3c02ac;hpb=0cdc9c96944885cf9141fda1a4d0bfdbd54c8ca6;p=dpdk.git diff --git a/examples/cmdline/commands.c b/examples/cmdline/commands.c index 06916d7832..4badffc257 100644 --- a/examples/cmdline/commands.c +++ b/examples/cmdline/commands.c @@ -12,12 +12,8 @@ #include #include #include -#ifndef __linux__ - #ifdef __FreeBSD__ - #include - #else - #include - #endif +#ifdef RTE_EXEC_ENV_FREEBSD +#include #endif #include @@ -145,7 +141,7 @@ static void cmd_obj_add_parsed(void *parsed_result, cmdline_printf(cl, "mem error\n"); return; } - snprintf(o->name, sizeof(o->name), "%s", res->name); + strlcpy(o->name, res->name, sizeof(o->name)); o->ip = res->ip; SLIST_INSERT_HEAD(&global_obj_list, o, next);