diff options
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r-- | lib/vsprintf.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 4da1e7aaf9d5..3a1e0843f9a2 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c | |||
@@ -1235,8 +1235,12 @@ char *escaped_string(char *buf, char *end, u8 *addr, struct printf_spec spec, | |||
1235 | 1235 | ||
1236 | len = spec.field_width < 0 ? 1 : spec.field_width; | 1236 | len = spec.field_width < 0 ? 1 : spec.field_width; |
1237 | 1237 | ||
1238 | /* Ignore the error. We print as many characters as we can */ | 1238 | /* |
1239 | string_escape_mem(addr, len, &buf, end - buf, flags, NULL); | 1239 | * string_escape_mem() writes as many characters as it can to |
1240 | * the given buffer, and returns the total size of the output | ||
1241 | * had the buffer been big enough. | ||
1242 | */ | ||
1243 | buf += string_escape_mem(addr, len, buf, buf < end ? end - buf : 0, flags, NULL); | ||
1240 | 1244 | ||
1241 | return buf; | 1245 | return buf; |
1242 | } | 1246 | } |