[openib-general] [PATCH] mad: Add port number to MAD thread names

Hal Rosenstock halr at voltaire.com
Thu Nov 18 11:22:35 PST 2004


On Thu, 2004-11-18 at 14:00, Roland Dreier wrote:
>     Johannes> You mean
> 
>     Johannes> 	char name[sizeof "ib_mad123" + 1];
> 
>     Johannes> right? :)
> 
> No, actually sizeof a string includes the trailing nul.  Try the
> following program:
> 
>     int main() { printf("%d\n", (int) sizeof "123"); }
> 
> I bet it prints "4" :)

OK. It's back to just sizeof r.t. sizeof + 1...

-- Hal




More information about the general mailing list