Re: [dev] [dwm] scrot -s fails

From: anonymous <p37sitdu_AT_lavabit.com>
Date: Sat, 20 Aug 2011 01:53:14 +0400

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.
Received on Fri Aug 19 2011 - 23:53:14 CEST

This archive was generated by hypermail 2.2.0 : Sat Aug 20 2011 - 00:00:10 CEST