'Wrapper for leak functions which leak strings, such that a NULL
terminator is automaticall added.
This is useful if the data leaked is printed out as a NULL-terminated
string, via e.g. ``printf()``.'

@staticmethod
def String(function):

    @functools.wraps(function, updated=[])
    def string_wrapper(address, *a, **kw):
        result = function(address, *a, **kw)
        if isinstance(result, (str, bytes)):
            result += '\x00'
        return result
    return MemLeak(string_wrapper)
