In article <[email protected]>, Paul Goyette <[email protected]> wrote: >-=-=-=-=-=- > >+ const char *pipe_errmsg = "child: pipe write failed\n"; > > (void)unlink(lockfile); > >@@ -145,8 +146,8 @@ ATF_TC_BODY(randlock, tc) > switch (pid[i]) { > case 0: > if (write(pipe_fd[1], &pipe_out, 1) != 1) >- printf("write_pipe(%i): %s", i, >- strerror(errno)); >+ write(STDERR_FILENO, pipe_errmsg, >+ __arraycount(pipe_errmsg));
foo is a pointer so this will print the first sizeof(char *) characters. Even if you correct it to be char foo[] you need arraycount() - 1 so you don't print the NUL. christos
