projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6eef5e
)
working string toaddress
author
Matthias Wachs
<wachs@net.in.tum.de>
Fri, 27 Apr 2012 13:44:49 +0000
(13:44 +0000)
committer
Matthias Wachs
<wachs@net.in.tum.de>
Fri, 27 Apr 2012 13:44:49 +0000
(13:44 +0000)
src/transport/plugin_transport_unix.c
patch
|
blob
|
history
diff --git
a/src/transport/plugin_transport_unix.c
b/src/transport/plugin_transport_unix.c
index 9027c27737b6bffd7b0c4f8b0a84008002bfbb4d..a195fb7f8effe758dae25170424da18e39ded9e2 100644
(file)
--- a/
src/transport/plugin_transport_unix.c
+++ b/
src/transport/plugin_transport_unix.c
@@
-1034,14
+1034,14
@@
unix_string_to_address (void *cls, const char *addr, uint16_t addrlen,
return GNUNET_SYSERR;
}
- if ((strlen (addr) + 1) != addrlen)
- {
-
GNUNET_break (0)
;
- return GNUNET_SYSERR;
- }
+ char * tmp = GNUNET_malloc (addrlen + 1);
+ memcpy (tmp, addr, addrlen);
+
tmp[addrlen] = '\0'
;
+
+ //GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "`%s'\n", tmp);
- (*buf) =
GNUNET_strdup (addr)
;
- (*added) = strlen (
addr) + 1
;
+ (*buf) =
tmp
;
+ (*added) = strlen (
tmp)
;
return GNUNET_OK;
}