1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Extra utility function add_to_commasep_pl.

Just like add_to_commasep, but takes a ptrlen.
This commit is contained in:
Simon Tatham 2022-04-20 10:32:14 +01:00
parent 9aae695c62
commit 3a54f28a4e
2 changed files with 8 additions and 2 deletions

1
ssh.h
View File

@ -1732,6 +1732,7 @@ unsigned alloc_channel_id_general(tree234 *channels, size_t localid_offset);
alloc_channel_id_general(tree, offsetof(type, localid))) alloc_channel_id_general(tree, offsetof(type, localid)))
void add_to_commasep(strbuf *buf, const char *data); void add_to_commasep(strbuf *buf, const char *data);
void add_to_commasep_pl(strbuf *buf, ptrlen data);
bool get_commasep_word(ptrlen *list, ptrlen *word); bool get_commasep_word(ptrlen *list, ptrlen *word);
SeatPromptResult verify_ssh_host_key( SeatPromptResult verify_ssh_host_key(

View File

@ -607,11 +607,16 @@ unsigned alloc_channel_id_general(tree234 *channels, size_t localid_offset)
* lists of protocol identifiers in SSH-2. * lists of protocol identifiers in SSH-2.
*/ */
void add_to_commasep(strbuf *buf, const char *data) void add_to_commasep_pl(strbuf *buf, ptrlen data)
{ {
if (buf->len > 0) if (buf->len > 0)
put_byte(buf, ','); put_byte(buf, ',');
put_data(buf, data, strlen(data)); put_datapl(buf, data);
}
void add_to_commasep(strbuf *buf, const char *data)
{
add_to_commasep_pl(buf, ptrlen_from_asciz(data));
} }
bool get_commasep_word(ptrlen *list, ptrlen *word) bool get_commasep_word(ptrlen *list, ptrlen *word)