Searched hist:"3 aeddc7d665e41b1ba193f5c427ca52086d085ae" (Results 1 – 1 of 1) sorted by relevance
/linux/lib/ |
H A D | string_helpers.c | diff 3aeddc7d665e41b1ba193f5c427ca52086d085ae Thu Apr 16 01:17:25 CEST 2015 Rasmus Villemoes <linux@rasmusvillemoes.dk> lib/string_helpers.c: refactor string_escape_mem
When printf is given the format specifier %pE, it needs a way of obtaining the total output size that would be generated if the buffer was large enough, and string_escape_mem doesn't easily provide that. This is a refactorization of string_escape_mem in preparation of changing its external API to provide that information.
The somewhat ugly early returns and subsequent seemingly redundant conditionals are to make the following patch touch as little as possible in string_helpers.c while still preserving the current behaviour of never outputting partial escape sequences. That behaviour must also change for %pE to work as one expects from every other printf specifier.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|