www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples

Archive Index This month's Index

Subject: Re: knownhost_writeline buffer length

Re: knownhost_writeline buffer length

From: Alexander Lamaison <swish_at_lammy.co.uk>
Date: Thu, 25 Feb 2010 03:12:54 +0000

On 24 February 2010 22:09, Peter Stuge <peter_at_stuge.se> wrote:
> Alexander Lamaison wrote:
>> Do we want libssh2_knownhost_writeline to NULL-terminate the line
>> it writes to the buffer?
> ..
>> The reason I ask is that the documentation says the value put in the
>> outlen parameter when the buffer is too small is "the size libssh2
>> wanted to store, which then is the smallest sufficient buffer it would
>> require".
> ..
>> Opinions?
>
> Compare snprintf(), I say make the code count every byte.

By count every byte do you mean include the byte used by the NULL-terminator?

Alex
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-02-25

the libssh2 team