OSSP CVS Repository

ossp - Difference in ossp-pkg/lmtp2nntp/lmtp2nntp_lmtp.c versions 1.3 and 1.4
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/lmtp2nntp/lmtp2nntp_lmtp.c 1.3 -> 1.4

--- lmtp2nntp_lmtp.c     2003/01/30 19:42:13     1.3
+++ lmtp2nntp_lmtp.c     2003/01/30 19:45:20     1.4
@@ -88,7 +88,7 @@
     int i;
 
     for (i = 0; (i < LMTP_MAXVERBS) && (lmtp->dispatch[i] != NULL); i++)
-        if (strcasecmp(lmtp->dispatch[i]->verb, verb) == 0) 
+        if (strcasecmp(lmtp->dispatch[i]->verb, verb) == 0)
             return i;
     return -1;
 }
@@ -109,7 +109,7 @@
 {
     /*  create a lmtp structure allocating memory for it and initializing it.
      *  A lmtp_cb_default() callback is registered for the default "" verb.
-     *  The _rfd_ and _wfd_ args are passed to the read(), write() 
+     *  The _rfd_ and _wfd_ args are passed to the read(), write()
      *  functions and must have meaning for them. If _io_ is NULL,
      *  the system io functions are used. You can provide an _io_ structure
      *  and specify alternate functions. Ommiting one or more functions inside
@@ -118,10 +118,10 @@
      */
     lmtp_t *lmtp;
 
-    if ((lmtp = (lmtp_t *)malloc(sizeof(lmtp_t))) == NULL) 
+    if ((lmtp = (lmtp_t *)malloc(sizeof(lmtp_t))) == NULL)
         return NULL;
 
-    if (io == NULL) 
+    if (io == NULL)
         return NULL;
 
     lmtp->io.ctx    = io->ctx;
@@ -132,7 +132,7 @@
     lmtp->rl.rl_cnt = 0;
     lmtp->rl.rl_bufptr = NULL;
     lmtp->rl.rl_buf[0] = NUL;
-    
+
     if ((lmtp->dispatch = (lmtp_dispatch_t **)malloc(sizeof(void *)*LMTP_MAXVERBS)) == NULL)
         return NULL;
     lmtp->dispatch[0] = NULL;
@@ -192,7 +192,7 @@
 
     }
     buf[n] = NUL;          /* string termination */
-    if (n == (buflen-1)) 
+    if (n == (buflen-1))
         return LMTP_ERR_OVERFLOW;
     return LMTP_OK;
 }
@@ -232,12 +232,12 @@
     while (1) {
         rc = lmtp_readline(lmtp, cpPtr, nBuf-(cpPtr-cpBuf));
         if (rc == LMTP_ERR_OVERFLOW) {
-            if (nBuf == maxlen) 
+            if (nBuf == maxlen)
                 return LMTP_ERR_OVERFLOW;
             offset = nBuf-1;                    /* write cursor offset is end of buffer */
             offsetline = cpLine - cpBuf;        /* remember start of line offset */
             nBuf *= 2;                          /* increase buffer */
-            if (nBuf > maxlen) 
+            if (nBuf > maxlen)
                 nBuf = maxlen;                  /* but don't exceed maximum */
             if ((cpBufrealloc = (char *)realloc(cpBuf, nBuf)) == NULL) {
                 free(cpBuf);
@@ -266,10 +266,10 @@
 }
 
 lmtp_rc_t lmtp_request(lmtp_t *lmtp, lmtp_req_t *req)
-{  
+{
     /*  reads a line and attaches the buffer to req->msg;
      *  pulls the verb out and attaches the verb to req->verb;
-     * 
+     *
      *  LMTP_OK           req->msg set, req->verb set  means normal operation
      *  LMTP_OK           req->msg set, req->verb ""   means no verb seen
      *  LMTP_EOF          req->msg set, req->verb NULL means eof
@@ -295,7 +295,7 @@
         return rc;
     for (i = 0; (i < LMTP_MAXVERBS) && (lmtp->dispatch[i] != NULL); i++) {
         if ((verb = lmtp->dispatch[i]->verb) != NULL) {  /* skip NULL verb */
-            if ((verblen = strlen(verb)) == 0) 
+            if ((verblen = strlen(verb)) == 0)
                 continue; /* skip  ""  verb */
             if (   (strlen(req->msg) >= verblen)
                 && (strncasecmp(req->msg, verb, verblen) == 0)
@@ -411,9 +411,9 @@
 
     if (cb == NULL) { /* checking for existing callback only */
         i = verbindex(lmtp, verb);
-        if (oldcb  != NULL) 
+        if (oldcb  != NULL)
             *oldcb  = (i == -1) ? NULL : lmtp->dispatch[i]->cb;
-        if (oldctx != NULL) 
+        if (oldctx != NULL)
             *oldctx = (i == -1) ? NULL : lmtp->dispatch[i]->ctx;
         return LMTP_OK;
     }
@@ -421,24 +421,24 @@
     for (i = 0; lmtp->dispatch[i] != NULL; i++) {
         if (strcasecmp(verb, lmtp->dispatch[i]->verb) == 0) {
             overload = 1;
-            if (oldcb  != NULL) 
+            if (oldcb  != NULL)
                 *oldcb  = lmtp->dispatch[i]->cb;
-            if (oldctx != NULL) 
+            if (oldctx != NULL)
                 *oldctx = lmtp->dispatch[i]->ctx;
             break;
         }
     }
-    if (i > LMTP_MAXVERBS-2) 
+    if (i > LMTP_MAXVERBS-2)
         return LMTP_ERR_OVERFLOW;
 
     if (!overload) {
-        if ((lmtp->dispatch[i] = 
+        if ((lmtp->dispatch[i] =
             (lmtp_dispatch_t *)malloc(sizeof(lmtp_dispatch_t))) == NULL)
             return LMTP_ERR_MEM;
         lmtp->dispatch[i+1] = NULL;
-        if (oldcb  != NULL) 
+        if (oldcb  != NULL)
             *oldcb  = NULL;
-        if (oldctx != NULL) 
+        if (oldctx != NULL)
             *oldctx = NULL;
     }
 
@@ -471,7 +471,7 @@
     res.statuscode = "220";
     res.dsncode    = NULL;
     res.statusmsg  = "LMTP Service ready.";
-    if ((rc = lmtp_response(lmtp, &res)) != LMTP_OK) 
+    if ((rc = lmtp_response(lmtp, &res)) != LMTP_OK)
         return rc;
 
     while ((rc = lmtp_request(lmtp, &req)) == LMTP_OK) {
@@ -483,7 +483,7 @@
             req.verb = "";
             req.msg = NULL;
 
-            if (rc != LMTP_OK) 
+            if (rc != LMTP_OK)
                 break;
         }
     }

CVSTrac 2.0.1