aboutsummaryrefslogtreecommitdiff
path: root/src/util/bio.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-06 09:35:14 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-06 09:35:14 +0000
commit99ba3c2b1294b890671d0d7d6e4319be70bee5a0 (patch)
tree2e9b1339869d5f115b80246b63af6c0604023e75 /src/util/bio.c
parentaee28f4afd42710aba0c37d8ec86572aef092044 (diff)
downloadgnunet-99ba3c2b1294b890671d0d7d6e4319be70bee5a0.tar.gz
gnunet-99ba3c2b1294b890671d0d7d6e4319be70bee5a0.zip
-doxygen, coding conventions
Diffstat (limited to 'src/util/bio.c')
-rw-r--r--src/util/bio.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/util/bio.c b/src/util/bio.c
index 0c62021b5..0a1c213f3 100644
--- a/src/util/bio.c
+++ b/src/util/bio.c
@@ -219,12 +219,14 @@ GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h,
219 * @param what describes what is being read (for error message creation) 219 * @param what describes what is being read (for error message creation)
220 * @param result the buffer to store a pointer to the (allocated) string to 220 * @param result the buffer to store a pointer to the (allocated) string to
221 * (note that *result could be set to NULL as well) 221 * (note that *result could be set to NULL as well)
222 * @param maxLen maximum allowed length for the string 222 * @param max_length maximum allowed length for the string
223 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure 223 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
224 */ 224 */
225int 225int
226GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, 226GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h,
227 char **result, size_t maxLen) 227 const char *what,
228 char **result,
229 size_t max_length)
228{ 230{
229 char *buf; 231 char *buf;
230 uint32_t big; 232 uint32_t big;
@@ -240,10 +242,10 @@ GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what,
240 *result = NULL; 242 *result = NULL;
241 return GNUNET_OK; 243 return GNUNET_OK;
242 } 244 }
243 if (big > maxLen) 245 if (big > max_length)
244 { 246 {
245 GNUNET_asprintf (&h->emsg, _("String `%s' longer than allowed (%u > %u)"), 247 GNUNET_asprintf (&h->emsg, _("String `%s' longer than allowed (%u > %u)"),
246 what, big, maxLen); 248 what, big, max_length);
247 return GNUNET_SYSERR; 249 return GNUNET_SYSERR;
248 } 250 }
249 buf = GNUNET_malloc (big); 251 buf = GNUNET_malloc (big);
@@ -270,7 +272,8 @@ GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what,
270 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure 272 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
271 */ 273 */
272int 274int
273GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what, 275GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h,
276 const char *what,
274 struct GNUNET_CONTAINER_MetaData **result) 277 struct GNUNET_CONTAINER_MetaData **result)
275{ 278{
276 uint32_t size; 279 uint32_t size;
@@ -344,7 +347,8 @@ GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file,
344int 347int
345GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, 348GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h,
346 const char *file, 349 const char *file,
347 int line, int64_t * i) 350 int line,
351 int64_t *i)
348{ 352{
349 int64_t big; 353 int64_t big;
350 354