From f603c6b611a6ad55c9446d6e27dd81faa8e7d07a Mon Sep 17 00:00:00 2001 From: Bruno Randolf Date: Wed, 25 May 2005 14:32:52 +0000 Subject: [PATCH] fixing command line interfaces (-i ifX): sizeof(interf_n->name) returns the size of the pointer, not the length of the string --- src/interfaces.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interfaces.c b/src/interfaces.c index 4cf3033e..2dda4624 100644 --- a/src/interfaces.c +++ b/src/interfaces.c @@ -36,7 +36,7 @@ * to the project. For more information see the website or contact * the copyright holders. * - * $Id: interfaces.c,v 1.23 2005/05/23 14:12:57 kattemat Exp $ + * $Id: interfaces.c,v 1.24 2005/05/25 14:32:52 br1 Exp $ */ #include "defs.h" @@ -330,7 +330,7 @@ queue_if(char *name) interf_n->configured = 0; interf_n->index = olsr_cnf->ifcnt++; - strncpy(interf_n->name, name, sizeof(interf_n->name)); + strncpy(interf_n->name, name, strlen(name) + 1); interf_n->next = olsr_cnf->interfaces; olsr_cnf->interfaces = interf_n; -- 2.20.1