summaryrefslogtreecommitdiff
path: root/doc/examples/ex-serv-pgp.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-01-15 16:02:29 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-01-21 01:05:59 +0100
commit37c8eaecbdaebc62aa4c2e8671fb366d20f9bbe8 (patch)
tree97b62330682aa8a6912d8413088addbf52579c67 /doc/examples/ex-serv-pgp.c
parent99ad4c6b2ab76d386be76daed0c509e62d6334c7 (diff)
downloadgnutls-37c8eaecbdaebc62aa4c2e8671fb366d20f9bbe8.tar.gz
Fixed signed/unsigned warnings.
Dropped opaque type (replaced with uint8_t)
Diffstat (limited to 'doc/examples/ex-serv-pgp.c')
-rw-r--r--doc/examples/ex-serv-pgp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/doc/examples/ex-serv-pgp.c b/doc/examples/ex-serv-pgp.c
index 5c73b93691..6946d2947c 100644
--- a/doc/examples/ex-serv-pgp.c
+++ b/doc/examples/ex-serv-pgp.c
@@ -24,7 +24,6 @@
*/
-#define SA struct sockaddr
#define SOCKET_ERR(err,s) if(err==-1) {perror(s);return(1);}
#define MAX_BUF 1024
#define PORT 5556 /* listen to 5556 port */
@@ -74,7 +73,7 @@ main (void)
int sd, ret;
struct sockaddr_in sa_serv;
struct sockaddr_in sa_cli;
- int client_len;
+ socklen_t client_len;
char topbuf[512];
gnutls_session_t session;
char buffer[MAX_BUF + 1];
@@ -111,7 +110,7 @@ main (void)
setsockopt (listen_sd, SOL_SOCKET, SO_REUSEADDR, (void *) &optval,
sizeof (int));
- err = bind (listen_sd, (SA *) & sa_serv, sizeof (sa_serv));
+ err = bind (listen_sd, (struct sockaddr *) & sa_serv, sizeof (sa_serv));
SOCKET_ERR (err, "bind");
err = listen (listen_sd, 1024);
SOCKET_ERR (err, "listen");
@@ -123,7 +122,7 @@ main (void)
{
session = initialize_tls_session ();
- sd = accept (listen_sd, (SA *) & sa_cli, &client_len);
+ sd = accept (listen_sd, (struct sockaddr *) & sa_cli, &client_len);
printf ("- connection from %s, port %d\n",
inet_ntop (AF_INET, &sa_cli.sin_addr, topbuf,