aboutsummaryrefslogtreecommitdiff
path: root/src/util/network.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-20 16:35:27 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-20 16:35:27 +0000
commit37e614f321caf2fddab72c4055e35d1b360bfd59 (patch)
tree6565c67ac86195f3dbf810133245e2d554dc8218 /src/util/network.c
parent3f049445d7adc952e05c002d8414a15d68046c8e (diff)
downloadgnunet-37e614f321caf2fddab72c4055e35d1b360bfd59.tar.gz
gnunet-37e614f321caf2fddab72c4055e35d1b360bfd59.zip
-fix shortening routine to deal with longer hashes
Diffstat (limited to 'src/util/network.c')
-rw-r--r--src/util/network.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/network.c b/src/util/network.c
index 29dfe15c7..41fb4e54b 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -123,7 +123,7 @@ GNUNET_NETWORK_shorten_unixpath (char *unixpath)
123 if (slen < upm) 123 if (slen < upm)
124 return unixpath; /* no shortening required */ 124 return unixpath; /* no shortening required */
125 GNUNET_CRYPTO_hash (unixpath, slen, &sh); 125 GNUNET_CRYPTO_hash (unixpath, slen, &sh);
126 while (sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) + 126 while (16 +
127 strlen (unixpath) >= upm) 127 strlen (unixpath) >= upm)
128 { 128 {
129 if (NULL == (end = strrchr (unixpath, '/'))) 129 if (NULL == (end = strrchr (unixpath, '/')))
@@ -137,7 +137,7 @@ GNUNET_NETWORK_shorten_unixpath (char *unixpath)
137 *end = '\0'; 137 *end = '\0';
138 } 138 }
139 GNUNET_CRYPTO_hash_to_enc (&sh, &ae); 139 GNUNET_CRYPTO_hash_to_enc (&sh, &ae);
140 strcat (unixpath, (char*) ae.encoding); 140 strncat (unixpath, (char*) ae.encoding, 16);
141 return unixpath; 141 return unixpath;
142} 142}
143 143