[libc] Print "<NULL>" for wide-character NULL strings
authorMichael Brown <mcb30@ipxe.org>
Tue, 12 Apr 2016 10:51:05 +0000 (11:51 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 12 Apr 2016 10:53:06 +0000 (11:53 +0100)
commitcc8824ad4e9486b9fa64f1b1d078ff1963f71219
tree2b170bde860ac5b91d44ddb9ad6a4fcbe605810b
parent320488d0f921c0e13cb1ef2e31c23cd087d148e2
[libc] Print "<NULL>" for wide-character NULL strings

The existing code intends to print NULL strings as "<NULL>" (for the
sake of debug messages), but the logic is incorrect when handling
wide-character strings.  Fix the logic and add applicable unit tests.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/vsprintf.c
src/tests/vsprintf_test.c