Skip to content

Commit

Permalink
fix libtls-standalone tests for tls_read and tls_write changed api
Browse files Browse the repository at this point in the history
  • Loading branch information
zhicheng authored and busterb committed Nov 23, 2015
1 parent 7a82b7c commit 84f0a9d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libtls-standalone/tests/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ int main()
{
struct tls *tls;
struct tls_config *tls_config;
size_t written, read;
ssize_t written, read;
char buf[4096];

if (tls_init() != 0) {
Expand All @@ -31,10 +31,10 @@ int main()
if (tls_connect(tls, "google.com", "443") != 0)
goto err;

if (tls_write(tls, "GET /\r\n", 7, &written) != 0)
if ((written = tls_write(tls, "GET /\r\n", 7)) < 0)
goto err;

if (tls_read(tls, buf, sizeof(buf), &read) != 0)
if ((read = tls_read(tls, buf, sizeof(buf))) < 0)
goto err;

buf[read - 1] = '\0';
Expand Down

0 comments on commit 84f0a9d

Please sign in to comment.