diff options
| author | Christian Grothoff <christian@grothoff.org> | 2015-01-28 20:31:28 +0100 | 
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2015-01-28 20:31:28 +0100 | 
| commit | bc8f6e81a4d737625e05e5e268d0d682489873d5 (patch) | |
| tree | b706d187c7627c7522ff1ef1eb8663dc11c88d17 /src/util | |
| parent | 62d3d352502f5b1d109b18456a87c704a70fcca5 (diff) | |
move data_to_string_alloc to GNUnet
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/json.c | 3 | ||||
| -rw-r--r-- | src/util/util.c | 30 | 
2 files changed, 2 insertions, 31 deletions
| diff --git a/src/util/json.c b/src/util/json.c index 120e1be5..fecf0c5a 100644 --- a/src/util/json.c +++ b/src/util/json.c @@ -133,7 +133,8 @@ TALER_JSON_from_data (const void *data, size_t size)  {    char *buf;    json_t *json; -  buf = TALER_data_to_string_alloc (data, size); + +  buf = GNUNET_STRINGS_data_to_string_alloc (data, size);    json = json_string (buf);    GNUNET_free (buf);    return json; diff --git a/src/util/util.c b/src/util/util.c index de085d08..b09f4dbd 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -28,36 +28,6 @@  #include <gnunet/gnunet_util_lib.h>  #include <gcrypt.h> -/** - * Return the base32crockford encoding of the given buffer. - * - * The returned string will be freshly allocated, and must be free'd - * with GNUNET_free(). - * - * @param buffer with data - * @param size size of the buffer - * @return freshly allocated, null-terminated string - */ -char * -TALER_data_to_string_alloc (const void *buf, size_t size) -{ -  char *str_buf; -  size_t len = size * 8; -  char *end; - -  if (len % 5 > 0) -    len += 5 - len % 5; -  len /= 5; -  str_buf = GNUNET_malloc (len + 1); -  end = GNUNET_STRINGS_data_to_string (buf, size, str_buf, len); -  if (NULL == end) -  { -    GNUNET_free (str_buf); -    return NULL; -  } -  *end = '\0'; -  return str_buf; -}  /** | 
