On Fri, Aug 19, 2011 at 07:30:08PM +0000, Bjartur Thorlacius wrote: > Þann fös 19.ágú 2011 18:22, skrifaði Bastien Dejean: > >static const char *partialshotcmd[] = { "scrot", "-s", NULL }; > > > I'd guess that the argument is never passed, as the string is > terminated by the NUL after scrot. > > If I read your code correctly, the array contains: > s, c, r, o, t, NUL, -, s, NUL, NULL. > > Where the trailing NULL is probably equal to NUL as well. That's > three NUL instead of the intended one - as C's string notation > appends NULs after the character array. >
The array contains tree pointers: pointer to NUL-terminated "scrot" string, pointer to NUL-terminated "-s" string and NULL pointer.