On Wed, 13.08.14 16:35, Dave Reisner (dreis...@archlinux.org) wrote:

Looks good. The code is certainly not any more complicated than the
current strapenda3(), so it sounds like something to apply.

>                  /* If the passed init is actually the same as the
>                   * systemd binary, then let's suppress it. */
> diff --git a/src/test/test-util.c b/src/test/test-util.c
> index 16f89b4..8776899 100644
> --- a/src/test/test-util.c
> +++ b/src/test/test-util.c
> @@ -907,6 +907,12 @@ static void test_strshorten(void) {
>          assert_se(strlen(strshorten(s, 0)) == 0);
>  }
>  
> +static void test_strappenda(void) {
> +        assert_se(streq(strappenda("", "foo", "bar"), "foobar"));
> +        assert_se(streq(strappenda("foo", "bar", "baz"), "foobarbaz"));
> +        assert_se(streq(strappenda("foo", "", "bar", "baz"), "foobarbaz"));
> +}

it's not portable to avoid alloca() when invoking a function (which the
strlen() in streq() is). This is documented in the alloca(3) man page,
see section "BUGS".

Can you change the test to first place the result of strappenda() in a
variable, and then pass that on to streq()? 

Please commit then! 

Thanks!

Lennart

-- 
Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to