]> git.ipfire.org Git - thirdparty/man-pages.git/commit
pthread_create.3: Fix bug in EXAMPLE program
authorKarsten Weiss <knweiss@gmail.com>
Wed, 5 Nov 2008 14:26:44 +0000 (09:26 -0500)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Thu, 6 Nov 2008 21:49:05 +0000 (16:49 -0500)
commit061f742a28799eef8e7fe204fe3f7b0541b7f6c9
tree5aa3be10ade4a54181f2ba7830578e25e3c678a3
parentc94081aa453c6c903c3c3c7ceab9cfe0efe0a406
pthread_create.3: Fix bug in EXAMPLE program

The bug is in this part of the code:

    /* Allocate memory for pthread_create() arguments */

    tinfo = calloc(num_threads, num_threads);
    if (tinfo == NULL)
       errExit("calloc");

The calloc() line should read like this instead:

    tinfo = calloc(num_threads, sizeof(struct thread_info));

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man3/pthread_create.3