sks-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1] Fix non tail recursion in sksdump (was: [Sks-devel] [PATCH] Bu


From: Kim Minh Kaplan
Subject: [PATCH 1] Fix non tail recursion in sksdump (was: [Sks-devel] [PATCH] Bundle IPv6, DNS fixes, sks dump fix)
Date: Wed, 25 Mar 2009 13:59:52 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Fix non tail recursion in sksdump.
http://lists.gnu.org/archive/html/sks-devel/2009-03/msg00090.html

Kim Minh.
diff -r e30dc5376cbb -r b49747d1b1d0 sksdump.ml
--- a/sksdump.ml        Fri May 23 21:16:40 2008 -0400
+++ b/sksdump.ml        Wed Mar 25 12:08:39 2009 +0000
@@ -46,19 +46,22 @@
       match SStream.next stream with
        | None -> ()
        | Some (hash,string) ->
+           let remain =
            try
              let skey = Keydb.skey_of_string string in
              if should_dump skey then
                let keystring = Keydb.keystring_of_skey skey in
                output_string cout keystring;
-               write_to_file (size - 1) stream cout
+               size - 1
              else
-               write_to_file size stream cout
+               size
            with
                e -> 
                  eplerror 1 e "Failed attempt to extract key %s" 
                  (KeyHash.hexify hash);
-                 write_to_file size stream cout
+                 size
+           in
+           write_to_file remain stream cout
 
 
   let write_to_fname size stream fname = 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]