Fixed nul string termination allocation.

This commit is contained in:
Jose Marcial Vieira Bisneto 2017-09-27 11:38:05 -03:00
parent c56d58f404
commit 350b8460fd
No known key found for this signature in database
GPG key ID: 103E935E7E6E831E

View file

@ -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 != '%'){