summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2006-03-08 10:45:53 +0000
committerSimon Josefsson <simon@josefsson.org>2006-03-08 10:45:53 +0000
commitea25eab9171c08eded855de88f78088845d70db9 (patch)
tree69b8026dd5091dfcdf2291a4d88091e852633886
parentecf486cb56539018cd5efac9ca986bf36c09c252 (diff)
downloadgnutls-ea25eab9171c08eded855de88f78088845d70db9.tar.gz
Indent.
-rw-r--r--lib/x509/crq.c3
-rw-r--r--lib/x509/xml.c3
-rw-r--r--src/cli.c13
-rw-r--r--src/common.c33
-rw-r--r--src/common.h2
-rw-r--r--src/serv.c11
-rw-r--r--tests/resume.c15
7 files changed, 42 insertions, 38 deletions
diff --git a/lib/x509/crq.c b/lib/x509/crq.c
index 07967601fb..4ff6ac3a8f 100644
--- a/lib/x509/crq.c
+++ b/lib/x509/crq.c
@@ -442,8 +442,7 @@ cleanup:
**/
int
gnutls_x509_crq_get_challenge_password (gnutls_x509_crq_t crq,
- char *pass,
- size_t * sizeof_pass)
+ char *pass, size_t * sizeof_pass)
{
if (crq == NULL)
{
diff --git a/lib/x509/xml.c b/lib/x509/xml.c
index 89d4fb3692..4f55eae282 100644
--- a/lib/x509/xml.c
+++ b/lib/x509/xml.c
@@ -499,7 +499,8 @@ _gnutls_asn1_get_structure_xml (ASN1_TYPE structure,
type_field (up->left->type) == TYPE_OBJECT_ID)
{
- len2 = asn1_get_length_der (up->value, up->value_len, &len3);
+ len2 =
+ asn1_get_length_der (up->value, up->value_len, &len3);
if (len2 > 0 && strcmp (p->name, "type") == 0)
{
diff --git a/src/cli.c b/src/cli.c
index 2637606fed..efb616a295 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -54,7 +54,7 @@
/* global stuff here */
int resume, starttls, insecure;
char *hostname = NULL;
-char* service;
+char *service;
int record_max_size;
int fingerprint;
int crlf;
@@ -526,11 +526,12 @@ main (int argc, char **argv)
sd = socket (AF_INET, SOCK_STREAM, 0);
ERR (sd, "socket");
- port = service_to_port( service);
- if (port == -1) {
- fprintf(stderr, "Unknown service\n");
- return -1;
- }
+ port = service_to_port (service);
+ if (port == -1)
+ {
+ fprintf (stderr, "Unknown service\n");
+ return -1;
+ }
memset (&sa, '\0', sizeof (sa));
sa.sin_family = AF_INET;
diff --git a/src/common.c b/src/common.c
index eec613d165..2c588ec8c2 100644
--- a/src/common.c
+++ b/src/common.c
@@ -823,20 +823,23 @@ sockets_init (void)
*
* returns -1 on error;
*/
-int service_to_port( const char* service)
+int
+service_to_port (const char *service)
{
-int port;
-struct servent *server_port;
-
- port = atoi(service);
- if (port!=0) return port;
-
- server_port = getservbyname( service, "tcp");
- if (server_port == NULL) {
- perror("getservbyname()");
- return(-1);
- }
-
- return ntohs(server_port->s_port);
-
+ int port;
+ struct servent *server_port;
+
+ port = atoi (service);
+ if (port != 0)
+ return port;
+
+ server_port = getservbyname (service, "tcp");
+ if (server_port == NULL)
+ {
+ perror ("getservbyname()");
+ return (-1);
+ }
+
+ return ntohs (server_port->s_port);
+
}
diff --git a/src/common.h b/src/common.h
index acc313054b..4531529f2d 100644
--- a/src/common.h
+++ b/src/common.h
@@ -35,7 +35,7 @@ void parse_ciphers (char **ciphers, int nciphers, int *cipher_priority);
void parse_protocols (char **protocols, int protocols_size,
int *protocol_priority);
const char *raw_to_string (const unsigned char *raw, size_t raw_size);
-int service_to_port( const char* service);
+int service_to_port (const char *service);
void sockets_init (void);
diff --git a/src/serv.c b/src/serv.c
index 57cb9136f5..492b598707 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -118,12 +118,11 @@ static int wrap_db_delete (void *dbf, gnutls_datum key);
#define HTTP_STATE_RESPONSE 2
#define HTTP_STATE_CLOSING 3
-LIST_TYPE_DECLARE (listener_item, char *http_request; char *http_response;
- int request_length; int response_length;
- int response_written; int http_state; int fd;
- gnutls_session tls_session;
- int handshake_ok;
- );
+LIST_TYPE_DECLARE (listener_item, char *http_request;
+ char *http_response; int request_length;
+ int response_length; int response_written;
+ int http_state;
+ int fd; gnutls_session tls_session; int handshake_ok;);
static const char *
safe_strerror (int value)
diff --git a/tests/resume.c b/tests/resume.c
index 21c7a0b7eb..b8a0041a62 100644
--- a/tests/resume.c
+++ b/tests/resume.c
@@ -366,7 +366,8 @@ server (void)
{
close (sd);
gnutls_deinit (session);
- fail ("server: Handshake has failed (%s)\n\n", gnutls_strerror (ret));
+ fail ("server: Handshake has failed (%s)\n\n",
+ gnutls_strerror (ret));
return;
}
success ("server: Handshake was completed\n");
@@ -483,11 +484,11 @@ wrap_db_store (void *dbf, gnutls_datum_t key, gnutls_datum_t data)
if (debug)
{
unsigned int i;
- printf("key:\n");
+ printf ("key:\n");
for (i = 0; i < key.size; i++)
{
printf ("%02x ", key.data[i] & 0xFF);
- if ((i+1)%16 == 0)
+ if ((i + 1) % 16 == 0)
printf ("\n");
}
printf ("\n");
@@ -495,7 +496,7 @@ wrap_db_store (void *dbf, gnutls_datum_t key, gnutls_datum_t data)
for (i = 0; i < data.size; i++)
{
printf ("%02x ", data.data[i] & 0xFF);
- if ((i+1)%16 == 0)
+ if ((i + 1) % 16 == 0)
printf ("\n");
}
printf ("\n");
@@ -531,11 +532,11 @@ wrap_db_fetch (void *dbf, gnutls_datum_t key)
if (debug)
{
unsigned int i;
- printf("key:\n");
+ printf ("key:\n");
for (i = 0; i < key.size; i++)
{
printf ("%02x ", key.data[i] & 0xFF);
- if ((i+1)%16 == 0)
+ if ((i + 1) % 16 == 0)
printf ("\n");
}
printf ("\n");
@@ -566,7 +567,7 @@ wrap_db_fetch (void *dbf, gnutls_datum_t key)
for (i = 0; i < res.size; i++)
{
printf ("%02x ", res.data[i] & 0xFF);
- if ((i+1)%16 == 0)
+ if ((i + 1) % 16 == 0)
printf ("\n");
}
printf ("\n");