Re: [PATCH v3 3/3] lib/string_helpers.c: Change semantics of string_escape_mem

2015-03-03 Thread Andy Shevchenko
On Tue, 2015-03-03 at 00:03 +0100, Rasmus Villemoes wrote: > On Mon, Mar 02 2015, Andy Shevchenko > wrote: > > On Mon, 2015-02-23 at 23:55 +0100, Rasmus Villemoes wrote: > >> On Mon, Feb 23 2015, Andy Shevchenko > >> wrote: > > > >> > What about to make it a separate function *and* call from in

Re: [PATCH v3 3/3] lib/string_helpers.c: Change semantics of string_escape_mem

2015-03-02 Thread Rasmus Villemoes
On Mon, Mar 02 2015, Andy Shevchenko wrote: > On Mon, 2015-02-23 at 23:55 +0100, Rasmus Villemoes wrote: >> On Mon, Feb 23 2015, Andy Shevchenko >> wrote: > >> > What about to make it a separate function *and* call from inside of >> > test_string_escape? Would it work for you? >> >> See my ear

Re: [PATCH v3 3/3] lib/string_helpers.c: Change semantics of string_escape_mem

2015-03-02 Thread Andy Shevchenko
On Mon, 2015-02-23 at 23:55 +0100, Rasmus Villemoes wrote: > On Mon, Feb 23 2015, Andy Shevchenko > wrote: > >> If you insist on a separate function for doing the overflow testing, > >> I'll just rip it out from my code and let you add such a test later. > > > > What about to make it a separate

Re: [PATCH v3 3/3] lib/string_helpers.c: Change semantics of string_escape_mem

2015-02-23 Thread Rasmus Villemoes
On Mon, Feb 23 2015, Andy Shevchenko wrote: >> >> > So, why couldn't we split this to separate test case? It seems I already >> >> > pointed this out. >> >> > >> >> >> >> This actually provides better coverage >> > >> > I do not see much advantage of doing so. You may create a loop with >> > ran

Re: [PATCH v3 3/3] lib/string_helpers.c: Change semantics of string_escape_mem

2015-02-23 Thread Andy Shevchenko
On Sat, 2015-02-21 at 02:35 +0100, Rasmus Villemoes wrote: > On Tue, Feb 10 2015, Andy Shevchenko > wrote: > >> >> @@ -301,29 +301,26 @@ static __init void test_string_escape(const char > >> >> *name, > >> >> q_test += len; > >> >> } > >> >> > >> >> - q_real = st

Re: [PATCH v3 3/3] lib/string_helpers.c: Change semantics of string_escape_mem

2015-02-20 Thread Rasmus Villemoes
On Tue, Feb 10 2015, Andy Shevchenko wrote: >> >> --- >> >> index ab0d30e1e18f..5f759c3c2f60 100644 >> >> --- a/lib/test-string_helpers.c >> >> +++ b/lib/test-string_helpers.c >> >> @@ -264,12 +264,12 @@ static __init void test_string_escape(const char >> >> *name, >> >>

Re: [PATCH v3 3/3] lib/string_helpers.c: Change semantics of string_escape_mem

2015-02-10 Thread Andy Shevchenko
On Tue, 2015-02-10 at 14:02 +0100, Rasmus Villemoes wrote: > On Tue, Feb 10 2015, Andy Shevchenko > wrote: > > > On Tue, 2015-02-10 at 00:44 +0100, Rasmus Villemoes wrote: > >> The current semantics of string_escape_mem are inadequate for one of > >> its current users, vsnprintf(). If that is to

Re: [PATCH v3 3/3] lib/string_helpers.c: Change semantics of string_escape_mem

2015-02-10 Thread Rasmus Villemoes
On Tue, Feb 10 2015, Andy Shevchenko wrote: > On Tue, 2015-02-10 at 00:44 +0100, Rasmus Villemoes wrote: >> The current semantics of string_escape_mem are inadequate for one of >> its current users, vsnprintf(). If that is to honour its contract, it >> must know how much space would be needed for

Re: [PATCH v3 3/3] lib/string_helpers.c: Change semantics of string_escape_mem

2015-02-10 Thread Andy Shevchenko
On Tue, 2015-02-10 at 00:44 +0100, Rasmus Villemoes wrote: > The current semantics of string_escape_mem are inadequate for one of > its current users, vsnprintf(). If that is to honour its contract, it > must know how much space would be needed for the entire escaped > buffer, and string_escape_mem

[PATCH v3 3/3] lib/string_helpers.c: Change semantics of string_escape_mem

2015-02-09 Thread Rasmus Villemoes
The current semantics of string_escape_mem are inadequate for one of its current users, vsnprintf(). If that is to honour its contract, it must know how much space would be needed for the entire escaped buffer, and string_escape_mem provides no way of obtaining that (short of allocating a large eno