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

Roland Dreier roland at topspin.com
Thu Nov 18 11:00:14 PST 2004


    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" :)

 - R.




More information about the general mailing list