possibly fix another bug
This commit is contained in:
parent
46ac66dcd8
commit
086f6427ce
@ -701,7 +701,7 @@ static char *www_wordwrap(char *content, int cutoff) {
|
|||||||
char *last_space = NULL;
|
char *last_space = NULL;
|
||||||
char *ret = (char *)malloc(len + 1);
|
char *ret = (char *)malloc(len + 1);
|
||||||
int at = 0;
|
int at = 0;
|
||||||
|
int extra = 0;
|
||||||
if (ret == NULL) {
|
if (ret == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -732,7 +732,8 @@ static char *www_wordwrap(char *content, int cutoff) {
|
|||||||
line_count = strlen(&last_space[1]);
|
line_count = strlen(&last_space[1]);
|
||||||
last_space = NULL;
|
last_space = NULL;
|
||||||
} else {
|
} else {
|
||||||
ret = (char *)realloc(ret, strlen(content) + 2);
|
extra++;
|
||||||
|
ret = (char *)realloc(ret, strlen(content) + extra + 1);
|
||||||
if (ret == NULL) {
|
if (ret == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user