mirror of
https://github.com/rkd77/elinks.git
synced 2024-08-21 21:04:38 -04:00
Bug 912: Callers of realloc_line treat only values < 0 as errors.
This will let me change realloc_line to return the original length.
This commit is contained in:
parent
6b68d38131
commit
819653836a
@ -244,7 +244,7 @@ clear_hchars(struct html_context *html_context, int x, int y, int width)
|
|||||||
assert(part && part->document && width > 0);
|
assert(part && part->document && width > 0);
|
||||||
if_assert_failed return;
|
if_assert_failed return;
|
||||||
|
|
||||||
if (realloc_line(html_context, part->document, Y(y), X(x) + width - 1))
|
if (realloc_line(html_context, part->document, Y(y), X(x) + width - 1) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
assert(part->document->data);
|
assert(part->document->data);
|
||||||
@ -277,7 +277,7 @@ get_frame_char(struct html_context *html_context, struct part *part,
|
|||||||
assert(part && part->document && x >= 0 && y >= 0);
|
assert(part && part->document && x >= 0 && y >= 0);
|
||||||
if_assert_failed return NULL;
|
if_assert_failed return NULL;
|
||||||
|
|
||||||
if (realloc_line(html_context, part->document, Y(y), X(x)))
|
if (realloc_line(html_context, part->document, Y(y), X(x)) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
assert(part->document->data);
|
assert(part->document->data);
|
||||||
@ -325,7 +325,7 @@ draw_frame_vchars(struct part *part, int x, int y, int height,
|
|||||||
/* The template char is the first vertical char to be drawn. So
|
/* The template char is the first vertical char to be drawn. So
|
||||||
* copy it to the rest. */
|
* copy it to the rest. */
|
||||||
for (height -= 1, y += 1; height; height--, y++) {
|
for (height -= 1, y += 1; height; height--, y++) {
|
||||||
if (realloc_line(html_context, part->document, Y(y), X(x)))
|
if (realloc_line(html_context, part->document, Y(y), X(x)) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
copy_screen_chars(&POS(x, y), template, 1);
|
copy_screen_chars(&POS(x, y), template, 1);
|
||||||
@ -417,7 +417,7 @@ set_hline(struct html_context *html_context, unsigned char *chars, int charslen,
|
|||||||
* the first byte of input can result in a double-cell
|
* the first byte of input can result in a double-cell
|
||||||
* character, so we must reserve one extra element. */
|
* character, so we must reserve one extra element. */
|
||||||
if (realloc_line(html_context, part->document,
|
if (realloc_line(html_context, part->document,
|
||||||
Y(y), X(x) + charslen))
|
Y(y), X(x) + charslen) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
if (utf8) {
|
if (utf8) {
|
||||||
unsigned char *end = chars + charslen;
|
unsigned char *end = chars + charslen;
|
||||||
@ -564,7 +564,7 @@ set_hline(struct html_context *html_context, unsigned char *chars, int charslen,
|
|||||||
|
|
||||||
if (part->document) {
|
if (part->document) {
|
||||||
if (realloc_line(html_context, part->document,
|
if (realloc_line(html_context, part->document,
|
||||||
Y(y), X(x) + charslen - 1))
|
Y(y), X(x) + charslen - 1) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (; charslen > 0; charslen--, x++, chars++) {
|
for (; charslen > 0; charslen--, x++, chars++) {
|
||||||
@ -713,7 +713,7 @@ copy_chars(struct html_context *html_context, int x, int y, int width, struct sc
|
|||||||
assert(width > 0 && part && part->document && part->document->data);
|
assert(width > 0 && part && part->document && part->document->data);
|
||||||
if_assert_failed return;
|
if_assert_failed return;
|
||||||
|
|
||||||
if (realloc_line(html_context, part->document, Y(y), X(x) + width - 1))
|
if (realloc_line(html_context, part->document, Y(y), X(x) + width - 1) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
copy_screen_chars(&POS(x, y), d, width);
|
copy_screen_chars(&POS(x, y), d, width);
|
||||||
|
Loading…
Reference in New Issue
Block a user