Fixed nul string termination allocation.
This commit is contained in:
parent
c56d58f404
commit
350b8460fd
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ int h2b(int c)
|
||||||
|
|
||||||
char *libp2p_utils_url_decode(char *src)
|
char *libp2p_utils_url_decode(char *src)
|
||||||
{
|
{
|
||||||
char *p, *dst = malloc (strlen(src));
|
char *p, *dst = malloc (strlen(src) + 1);
|
||||||
|
|
||||||
for(p = dst ; *src ; src++ ) {
|
for(p = dst ; *src ; src++ ) {
|
||||||
if(*src != '%'){
|
if(*src != '%'){
|
||||||
|
|
Loading…
Reference in a new issue