Messages in this thread | | | From | Andrzej Krzysztofowicz <> | Subject | Re: [PATCH] net #9 | Date | Wed, 30 May 2001 12:28:04 +0200 (MET DST) |
| |
"Henning P. Schmiedehausen wrote:" > Andrzej Krzysztofowicz <ankry@green.mif.pg.gda.pl> writes: > > >-static char name[4][IFNAMSIZ] = { "", "", "", "" }; > > >+static char name[4][IFNAMSIZ]; > > Ugh. Sure about that one? the variables have been pointers to zero, > now they're zero...
I do not agree. As I understand C "name" is a table, i.e. a pointer to a prealocated area of size of 4*IFNAMSIZ*sizeof(char) bytes. There is no pointers to the strings stored seprately. [ The strings are copied into the apropriate locations in the array during initialization ]
After applying the mentioned patch just the whole area of the array will be zeroed. Not only the first characters of name[i] i=0,1,2,3 ...
Andrzej -- ======================================================================= Andrzej M. Krzysztofowicz ankry@mif.pg.gda.pl phone (48)(58) 347 14 61 Faculty of Applied Phys. & Math., Technical University of Gdansk
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |