diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2015-04-15 16:17:25 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-15 16:35:23 -0700 |
commit | 3aeddc7d665e41b1ba193f5c427ca52086d085ae (patch) | |
tree | 7f00129aa094227adc55ee92cc585f039a747fe5 /lib/usercopy.c | |
parent | 9c98f2359600386efd1c6adfabc5a04118a79798 (diff) |
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>
Diffstat (limited to 'lib/usercopy.c')
0 files changed, 0 insertions, 0 deletions