1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

testcrypt: add return_val_string_asciz_const.

A partial cherry-pick of commit 5cfc90ff0d
keeping just the one function I need on this branch.
This commit is contained in:
Simon Tatham 2020-01-06 19:58:25 +00:00
parent d51b3d7eb6
commit 3b1f458a0d

View File

@ -495,14 +495,19 @@ static void return_boolean(strbuf *out, bool b)
strbuf_catf(out, "%s\n", b ? "true" : "false");
}
static void return_val_string_asciz(strbuf *out, char *s)
static void return_val_string_asciz_const(strbuf *out, const char *s)
{
strbuf *sb = strbuf_new();
put_data(sb, s, strlen(s));
sfree(s);
return_val_string(out, sb);
}
static void return_val_string_asciz(strbuf *out, char *s)
{
return_val_string_asciz_const(out, s);
sfree(s);
}
#define NULLABLE_RETURN_WRAPPER(type_name, c_type) \
static void return_opt_##type_name(strbuf *out, c_type ptr) \
{ \