Re: [akaros] Fix listener / echo servers to handle char mode (e927e53)

3 views
Skip to first unread message

Dan Cross

unread,
Oct 15, 2015, 3:48:39 PM10/15/15
to brho/akaros

printf("%.*s", sizeof(buf), buf);

or since you know the buffer size,

printf("%.256s", buf);

Also, did you want a newline at the end of the print?


Reply to this email directly or view it on GitHub.

Dan Cross

unread,
Oct 15, 2015, 3:48:50 PM10/15/15
to brho/akaros

Same as above.

brho

unread,
Oct 15, 2015, 4:23:49 PM10/15/15
to brho/akaros
On 2015-10-15 at 12:48 Dan Cross <notifi...@github.com> wrote:
> printf("%.*s", sizeof(buf), buf);
>
> or since you know the buffer size,
>
> printf("%.256s", buf);
>
> Also, did you want a newline at the end of the print?

I didn't, actually.

I just wanted something that was a sanity check on what the server was
getting. Using %s wasn't enough, since I wasn't getting
null-terminated strings from the telnet client when it was not in line
mode.

Barret
Reply all
Reply to author
Forward
0 new messages