Re: [PATCH] net #9

From: Andrzej Krzysztofowicz (ankry@pg.gda.pl)
Date: Wed May 30 2001 - 05:28:04 EST


"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/



This archive was generated by hypermail 2b29 : Thu May 31 2001 - 21:00:45 EST