[Pkg-wmaker-commits] [wmbiff] 10/17: indent and add another check
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Thu Aug 20 03:04:20 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to tag wmbiff_0_4_18
in repository wmbiff.
commit cf552b49cfd25fdbd640e45a37ac396d2086f158
Author: bluehal <bluehal>
Date: Tue Oct 28 23:39:25 2003 +0000
indent and add another check
---
wmbiff/test_tlscomm.c | 107 ++++++++++++++++++++++++++++----------------------
1 file changed, 61 insertions(+), 46 deletions(-)
diff --git a/wmbiff/test_tlscomm.c b/wmbiff/test_tlscomm.c
index 197d4b6..93ca69d 100644
--- a/wmbiff/test_tlscomm.c
+++ b/wmbiff/test_tlscomm.c
@@ -8,47 +8,59 @@
int debug_default = 2;
int SkipCertificateCheck = 0;
const char *certificate_filename = NULL;
-int exists(const char *filename __attribute__((unused))) { return(0); }
-int print_info(void * state __attribute__((unused))) { return(0); }
+int exists(const char *filename __attribute__ ((unused)))
+{
+ return (0);
+}
+int print_info(void *state __attribute__ ((unused)))
+{
+ return (0);
+}
+
int Relax = 1;
int indices[12];
-const char *sequence[][4] = {
- { NULL, NULL, NULL, NULL },
- { "prefix", " hello", NULL },
- { "pre", "fix", " hello", NULL },
+const char *sequence[][4] = {
+ {NULL, NULL, NULL, NULL},
+ {"prefix", " hello", NULL},
+ {"pre", "fix", " hello", NULL},
+ {"\r\n", ")\r\n", "prefix", NULL},
+ {NULL, NULL, NULL, NULL},
};
/* trick tlscomm into believing it can read. */
-int read(int s, void *buf, size_t buflen) {
- int val = indices[s]++;
+int read(int s, void *buf, size_t buflen)
+{
+ int val = indices[s]++;
- if(sequence[s][val] == NULL) {
- indices[s]--; /* make it stay */
- return 0;
- } else {
- strncpy(buf, sequence[s][val], buflen);
- printf("read: %s\n", sequence[s][val]);
- return(strlen(sequence[s][val]));
- }
+ if (sequence[s][val] == NULL) {
+ indices[s]--; /* make it stay */
+ return 0;
+ } else {
+ strncpy(buf, sequence[s][val], buflen);
+ printf("read: %s\n", sequence[s][val]);
+ return (strlen(sequence[s][val]));
+ }
}
-int select(int nfds, fd_set *r, fd_set *w __attribute__((unused)),
- fd_set *x __attribute__((unused)),
- struct timeval *tv __attribute__((unused))) {
- int i;
- int ready = 0;
- for(i=0;i<nfds;i++) {
- if(FD_ISSET(i,r) && sequence[i][indices[i]] != NULL) {
- ready++;
- } else {
- FD_CLR(i,r);
- }
- }
- if(ready == 0) {
- printf("botched.\n");
- }
+int select(int nfds, fd_set * r,
+ fd_set * w __attribute__ ((unused)),
+ fd_set * x __attribute__ ((unused)),
+ struct timeval *tv __attribute__ ((unused)))
+{
+ int i;
+ int ready = 0;
+ for (i = 0; i < nfds; i++) {
+ if (FD_ISSET(i, r) && sequence[i][indices[i]] != NULL) {
+ ready++;
+ } else {
+ FD_CLR(i, r);
+ }
+ }
+ if (ready == 0) {
+ printf("botched.\n");
+ }
return ready;
}
@@ -60,22 +72,25 @@ struct connection_state {
/*@null@ */ void *tls_state;
/*@null@ */ void *xcred;
char unprocessed[BUF_SIZE];
- void * pc; /* mailbox handle for debugging messages */
+ void *pc; /* mailbox handle for debugging messages */
};
-int main(int argc __attribute__((unused)),
- char **argv __attribute__((unused))) {
- char buf[255];
- struct connection_state scs;
- scs.name = strdup("test");
- scs.unprocessed[0] = '\0';
- scs.pc = NULL;
- alarm(10);
-
- for(scs.sd = 1; scs.sd < 3; scs.sd++) {
- memset(scs.unprocessed, 0, BUF_SIZE);
- printf("%d\n", tlscomm_expect(&scs, "prefix", buf, 255));
- }
+int main(int argc __attribute__ ((unused)),
+ char **argv __attribute__ ((unused)))
+{
+ char buf[255];
+ struct connection_state scs;
+ scs.name = strdup("test");
+ scs.unprocessed[0] = '\0';
+ scs.pc = NULL;
+ scs.tls_state = NULL;
+ scs.xcred = NULL;
+ alarm(10);
+
+ for (scs.sd = 1; sequence[scs.sd][0] != NULL; scs.sd++) {
+ memset(scs.unprocessed, 0, BUF_SIZE);
+ printf("%d\n", tlscomm_expect(&scs, "prefix", buf, 255));
+ }
return 0;
-
+
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbiff.git
More information about the Pkg-wmaker-commits
mailing list