gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r9329 - GNUnet/src/applications/fs/gap


From: gnunet
Subject: [GNUnet-SVN] r9329 - GNUnet/src/applications/fs/gap
Date: Wed, 28 Oct 2009 12:12:49 -0600

Author: nevans
Date: 2009-10-28 12:12:49 -0600 (Wed, 28 Oct 2009)
New Revision: 9329

Modified:
   GNUnet/src/applications/fs/gap/test_gap_dv.c
Log:
weird character printing

Modified: GNUnet/src/applications/fs/gap/test_gap_dv.c
===================================================================
--- GNUnet/src/applications/fs/gap/test_gap_dv.c        2009-10-28 17:55:59 UTC 
(rev 9328)
+++ GNUnet/src/applications/fs/gap/test_gap_dv.c        2009-10-28 18:12:49 UTC 
(rev 9329)
@@ -462,6 +462,7 @@
   int ret = 0;
   int i;
   int j;
+  int len;
 
   unsigned int rand_peer;
   unsigned int temp_rand_peer;
@@ -557,7 +558,7 @@
                        if (ret != 0)
                        {
                                fprintf(stderr, "Got bad return (%d) from 
download, this one failed!\n", ret);
-                               finish_time = -1;
+                               finish_time = 0;
                        }
                        else
                        {
@@ -566,9 +567,10 @@
                        }
                        if (fd != -1)
                        {
-                               buf = GNUNET_malloc(snprintf(NULL, 0, 
"%d\t%d\t%llu\n", size, j, finish_time) + 1);
+                         len = snprintf(NULL, 0, "%d\t%d\t%llu\n", size, j, 
finish_time) + 1;
+                               buf = GNUNET_malloc(len);
                                sprintf(buf, "%d\t%d\t%llu\n", size, j, 
finish_time);
-                               ret = WRITE (fd, buf, snprintf(NULL, 0, 
"%d\t%d\t%llu\n", size, j, finish_time) + 1);
+                               ret = WRITE (fd, buf, len - 1);
                                GNUNET_free(buf);
                        }
                        if (GNUNET_shutdown_test() == GNUNET_YES)





reply via email to

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