gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r22385 - in gnunet/src: include util


From: gnunet
Subject: [GNUnet-SVN] r22385 - in gnunet/src: include util
Date: Fri, 29 Jun 2012 15:51:20 +0200

Author: harsha
Date: 2012-06-29 15:51:20 +0200 (Fri, 29 Jun 2012)
New Revision: 22385

Modified:
   gnunet/src/include/gnunet_configuration_lib.h
   gnunet/src/util/configuration.c
Log:
-configuration serialization size_t for size

Modified: gnunet/src/include/gnunet_configuration_lib.h
===================================================================
--- gnunet/src/include/gnunet_configuration_lib.h       2012-06-29 13:45:06 UTC 
(rev 22384)
+++ gnunet/src/include/gnunet_configuration_lib.h       2012-06-29 13:51:20 UTC 
(rev 22385)
@@ -121,8 +121,8 @@
  *           present. This memory should be freed by the caller
  */
 char *
-GNUNET_CONFIGURATION_serialize (struct GNUNET_CONFIGURATION_Handle *cfg,
-                               uint16_t *size);
+GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg,
+                               size_t *size);
 
 
 /**

Modified: gnunet/src/util/configuration.c
===================================================================
--- gnunet/src/util/configuration.c     2012-06-29 13:45:06 UTC (rev 22384)
+++ gnunet/src/util/configuration.c     2012-06-29 13:51:20 UTC (rev 22385)
@@ -347,8 +347,8 @@
  *           present. This memory should be freed by the caller
  */
 char *
-GNUNET_CONFIGURATION_serialize (struct GNUNET_CONFIGURATION_Handle *cfg,
-                               uint16_t *size)
+GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg,
+                               size_t *size)
 {
   struct ConfigSection *sec;
   struct ConfigEntry *ent;
@@ -356,9 +356,9 @@
   char *cbuf;
   char *val;
   char *pos;
-  uint16_t len;
-  uint16_t m_size;
-  uint16_t c_size;
+  int len;
+  size_t m_size;
+  size_t c_size;
 
 
   /* Pass1 : calculate the buffer size required */
@@ -399,6 +399,7 @@
   while (NULL != sec)
   {
     len = GNUNET_asprintf (&cbuf, "[%s]\n", sec->name);
+    GNUNET_assert (0 < len);
     memcpy (mem + c_size, cbuf, len);
     c_size += len;
     GNUNET_free (cbuf);
@@ -446,7 +447,7 @@
 {
   char *fn;
   char *cfg_buf;
-  uint16_t size;
+  size_t size;
 
   fn = GNUNET_STRINGS_filename_expand (filename);
   if (fn == NULL)




reply via email to

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