* plaintext.c (handle_plaintext): Properly handle a --max-output of zero
authorDavid Shaw <dshaw@jabberwocky.com>
Sun, 22 Feb 2004 04:16:31 +0000 (04:16 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Sun, 22 Feb 2004 04:16:31 +0000 (04:16 +0000)
(do not limit output at all).

g10/ChangeLog
g10/plaintext.c

index 679940f..141241c 100644 (file)
@@ -1,5 +1,8 @@
 2004-02-21  David Shaw  <dshaw@jabberwocky.com>
 
+       * plaintext.c (handle_plaintext): Properly handle a --max-output
+       of zero (do not limit output at all).
+
        * keyserver.c (keyserver_spawn): Use the full 64-bit keyid in the
        INFO header lines, and include "sig:" records for the benefit of
        people who store their keys in LDAP servers.  It makes it easy to
index e057d3f..a998acb 100644 (file)
@@ -168,7 +168,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
 #endif
                if( fp )
                  {
-                   if((count++)>opt.max_output)
+                   if(opt.max_output && (count++)>opt.max_output)
                      {
                        log_error("Error writing to `%s': %s\n",
                                  fname,"exceeded --max-output limit\n");
@@ -201,7 +201,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
                    md_write( mfx->md, buffer, len );
                if( fp )
                  {
-                   if((count+=len)>opt.max_output)
+                   if(opt.max_output && (count+=len)>opt.max_output)
                      {
                        log_error("Error writing to `%s': %s\n",
                                  fname,"exceeded --max-output limit\n");
@@ -234,7 +234,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
 #endif
                if( fp )
                  {
-                   if((count++)>opt.max_output)
+                   if(opt.max_output && (count++)>opt.max_output)
                      {
                        log_error("Error writing to `%s': %s\n",
                                  fname,"exceeded --max-output limit\n");
@@ -270,7 +270,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
                    md_write( mfx->md, buffer, len );
                if( fp )
                  {
-                   if((count+=len)>opt.max_output)
+                   if(opt.max_output && (count+=len)>opt.max_output)
                      {
                        log_error("Error writing to `%s': %s\n",
                                  fname,"exceeded --max-output limit\n");
@@ -297,7 +297,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
        while( (c = iobuf_get(pt->buf)) != -1 ) {
            if( fp )
              {
-               if((count++)>opt.max_output)
+               if(opt.max_output && (count++)>opt.max_output)
                  {
                    log_error("Error writing to `%s': %s\n",
                              fname,"exceeded --max-output limit\n");