diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-06-29 13:51:20 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-06-29 13:51:20 +0000 |
commit | 722980c056f396b25b5b15d6a805654d02b3c5ef (patch) | |
tree | af339f97870432f91850b68c845caef11666a7c3 /src/util/configuration.c | |
parent | 3b3debab9a5cd72ba5ec98d04ef08209f2f5b080 (diff) | |
download | gnunet-722980c056f396b25b5b15d6a805654d02b3c5ef.tar.gz gnunet-722980c056f396b25b5b15d6a805654d02b3c5ef.zip |
-configuration serialization size_t for size
Diffstat (limited to 'src/util/configuration.c')
-rw-r--r-- | src/util/configuration.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/util/configuration.c b/src/util/configuration.c index fea329d75..de6e542e8 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c | |||
@@ -347,8 +347,8 @@ GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
347 | * present. This memory should be freed by the caller | 347 | * present. This memory should be freed by the caller |
348 | */ | 348 | */ |
349 | char * | 349 | char * |
350 | GNUNET_CONFIGURATION_serialize (struct GNUNET_CONFIGURATION_Handle *cfg, | 350 | GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg, |
351 | uint16_t *size) | 351 | size_t *size) |
352 | { | 352 | { |
353 | struct ConfigSection *sec; | 353 | struct ConfigSection *sec; |
354 | struct ConfigEntry *ent; | 354 | struct ConfigEntry *ent; |
@@ -356,9 +356,9 @@ GNUNET_CONFIGURATION_serialize (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
356 | char *cbuf; | 356 | char *cbuf; |
357 | char *val; | 357 | char *val; |
358 | char *pos; | 358 | char *pos; |
359 | uint16_t len; | 359 | int len; |
360 | uint16_t m_size; | 360 | size_t m_size; |
361 | uint16_t c_size; | 361 | size_t c_size; |
362 | 362 | ||
363 | 363 | ||
364 | /* Pass1 : calculate the buffer size required */ | 364 | /* Pass1 : calculate the buffer size required */ |
@@ -399,6 +399,7 @@ GNUNET_CONFIGURATION_serialize (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
399 | while (NULL != sec) | 399 | while (NULL != sec) |
400 | { | 400 | { |
401 | len = GNUNET_asprintf (&cbuf, "[%s]\n", sec->name); | 401 | len = GNUNET_asprintf (&cbuf, "[%s]\n", sec->name); |
402 | GNUNET_assert (0 < len); | ||
402 | memcpy (mem + c_size, cbuf, len); | 403 | memcpy (mem + c_size, cbuf, len); |
403 | c_size += len; | 404 | c_size += len; |
404 | GNUNET_free (cbuf); | 405 | GNUNET_free (cbuf); |
@@ -446,7 +447,7 @@ GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
446 | { | 447 | { |
447 | char *fn; | 448 | char *fn; |
448 | char *cfg_buf; | 449 | char *cfg_buf; |
449 | uint16_t size; | 450 | size_t size; |
450 | 451 | ||
451 | fn = GNUNET_STRINGS_filename_expand (filename); | 452 | fn = GNUNET_STRINGS_filename_expand (filename); |
452 | if (fn == NULL) | 453 | if (fn == NULL) |