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

2015-02-02 Thread Andy Shevchenko
On Sat, 2015-01-31 at 00:39 +0100, Rasmus Villemoes wrote: > On Fri, Jan 30 2015, Andy Shevchenko > wrote: > >> >> * Return: > >> >> - * The amount of the characters processed to the destination buffer, or > >> >> - * %-ENOMEM if the size of buffer is not enough to put an escaped > >> >>

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

2015-02-02 Thread Andy Shevchenko
On Sat, 2015-01-31 at 00:39 +0100, Rasmus Villemoes wrote: On Fri, Jan 30 2015, Andy Shevchenko andriy.shevche...@linux.intel.com wrote: * Return: - * The amount of the characters processed to the destination buffer, or - * %-ENOMEM if the size of buffer is not enough to put an

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

2015-01-30 Thread Rasmus Villemoes
On Fri, Jan 30 2015, Andy Shevchenko wrote: > On Thu, 2015-01-29 at 15:29 +0100, Rasmus Villemoes wrote: >> On Thu, Jan 29 2015, Andy Shevchenko >> wrote: >> >> >> * >> >> * Return: >> >> - * The amount of the characters processed to the destination buffer, or >> >> - * %-ENOMEM if the

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

2015-01-30 Thread Andy Shevchenko
On Thu, 2015-01-29 at 15:29 +0100, Rasmus Villemoes wrote: > On Thu, Jan 29 2015, Andy Shevchenko > wrote: > > >> * > >> * Return: > >> - * The amount of the characters processed to the destination buffer, or > >> - * %-ENOMEM if the size of buffer is not enough to put an escaped > >>

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

2015-01-30 Thread Rasmus Villemoes
On Fri, Jan 30 2015, Andy Shevchenko andriy.shevche...@linux.intel.com wrote: On Thu, 2015-01-29 at 15:29 +0100, Rasmus Villemoes wrote: On Thu, Jan 29 2015, Andy Shevchenko andriy.shevche...@linux.intel.com wrote: * * Return: - * The amount of the characters processed to the

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

2015-01-30 Thread Andy Shevchenko
On Thu, 2015-01-29 at 15:29 +0100, Rasmus Villemoes wrote: On Thu, Jan 29 2015, Andy Shevchenko andriy.shevche...@linux.intel.com wrote: * * Return: - * The amount of the characters processed to the destination buffer, or - * %-ENOMEM if the size of buffer is not enough to put an

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

2015-01-29 Thread Rasmus Villemoes
On Thu, Jan 29 2015, Andy Shevchenko wrote: >> * >> * Return: >> - * The amount of the characters processed to the destination buffer, or >> - * %-ENOMEM if the size of buffer is not enough to put an escaped character >> is >> - * returned. >> - * >> - * Even in the case of error @dst

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

2015-01-29 Thread Andy Shevchenko
On Thu, 2015-01-29 at 11:03 +0100, Rasmus Villemoes wrote: Thanks for an update. Few comments below. > The current semantics of string_escape_mem are inadequate for one of > its two current users, vsnprintf(). If that is to honour its contract, > it must know how much space would be needed for

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

2015-01-29 Thread Rasmus Villemoes
The current semantics of string_escape_mem are inadequate for one of its two 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

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

2015-01-29 Thread Rasmus Villemoes
The current semantics of string_escape_mem are inadequate for one of its two 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

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

2015-01-29 Thread Andy Shevchenko
On Thu, 2015-01-29 at 11:03 +0100, Rasmus Villemoes wrote: Thanks for an update. Few comments below. The current semantics of string_escape_mem are inadequate for one of its two current users, vsnprintf(). If that is to honour its contract, it must know how much space would be needed for the

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

2015-01-29 Thread Rasmus Villemoes
On Thu, Jan 29 2015, Andy Shevchenko andriy.shevche...@linux.intel.com wrote: * * Return: - * The amount of the characters processed to the destination buffer, or - * %-ENOMEM if the size of buffer is not enough to put an escaped character is - * returned. - * - * Even in the case of