WPS: Fix http_link_update() to nul terminate the result
This commit is contained in:
parent
ecc6d04b89
commit
d64d9ddf6c
1 changed files with 3 additions and 2 deletions
|
@ -344,7 +344,7 @@ char * http_link_update(char *url, const char *base)
|
||||||
os_snprintf(n, len, "%s%s", base, url);
|
os_snprintf(n, len, "%s%s", base, url);
|
||||||
} else {
|
} else {
|
||||||
os_memcpy(n, base, pos - base);
|
os_memcpy(n, base, pos - base);
|
||||||
os_memcpy(n + (pos - base), url, os_strlen(url));
|
os_memcpy(n + (pos - base), url, os_strlen(url) + 1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pos = os_strrchr(base + 7, '/');
|
pos = os_strrchr(base + 7, '/');
|
||||||
|
@ -352,7 +352,8 @@ char * http_link_update(char *url, const char *base)
|
||||||
os_snprintf(n, len, "%s/%s", base, url);
|
os_snprintf(n, len, "%s/%s", base, url);
|
||||||
} else {
|
} else {
|
||||||
os_memcpy(n, base, pos - base + 1);
|
os_memcpy(n, base, pos - base + 1);
|
||||||
os_memcpy(n + (pos - base) + 1, url, os_strlen(url));
|
os_memcpy(n + (pos - base) + 1, url, os_strlen(url) +
|
||||||
|
1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue