OSSP CVS Repository

ossp - Check-in [1827]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1827
Date: 2002-Feb-07 14:38:08 (local)
2002-Feb-07 13:38:08 (UTC)
User:thl
Branch:
Comment: The '& 1' check is wrong as argz counts the characters not the pairs. The wholly check is not needed at all because while would skip empty pairs anyway.
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/lmtp2nntp_main.c      1.38 -> 1.39     12 inserted, 13 deleted

ossp-pkg/lmtp2nntp/lmtp2nntp_main.c 1.38 -> 1.39

--- lmtp2nntp_main.c     2002/02/06 13:51:38     1.38
+++ lmtp2nntp_main.c     2002/02/07 13:38:08     1.39
@@ -1435,20 +1435,19 @@
     /* Optionally add command line specified Header/Value Pairs
      */
     log0(ctx, TRACE, "adding header/value pairs");
-    if ((ctx->asHeaderValuePairs >= 1) && ((ctx->asHeaderValuePairs & 1) == 0)) {
-        cp = NULL;
-        while ((cp = argz_next(ctx->azHeaderValuePairs, ctx->asHeaderValuePairs, cp)) != NULL) {
-            var_rc_t var_rc;
-            char *res_ptr;
-            if ((var_rc = var_expand(cp, strlen(cp), &res_ptr, NULL,
-                                     ctx_lookup, ctx, &ctx_lookup_cfg, TRUE)) != VAR_OK) {
-                log2(ctx, ERROR, "expansion of '%s' failed: %s", cp, var_strerror(var_rc));
-                continue;
-            }
-            log1(ctx, DEBUG, "adding expanded header: \"%s\"", res_ptr);
-            argz_add(&ctx->msg->azHeaders, &ctx->msg->asHeaders, res_ptr);
-            free(res_ptr);
+
+    cp = NULL;
+    while ((cp = argz_next(ctx->azHeaderValuePairs, ctx->asHeaderValuePairs, cp)) != NULL) {
+        var_rc_t var_rc;
+        char *res_ptr;
+        if ((var_rc = var_expand(cp, strlen(cp), &res_ptr, NULL,
+                                 ctx_lookup, ctx, &ctx_lookup_cfg, TRUE)) != VAR_OK) {
+            log2(ctx, ERROR, "expansion of '%s' failed: %s", cp, var_strerror(var_rc));
+            continue;
         }
+        log1(ctx, DEBUG, "adding expanded header: \"%s\"", res_ptr);
+        argz_add(&ctx->msg->azHeaders, &ctx->msg->asHeaders, res_ptr);
+        free(res_ptr);
     }
 
     /*  RFC0821 4.2.1. REPLY CODES BY FUNCTION GROUPS   554 Transaction failed

CVSTrac 2.0.1