summaryrefslogtreecommitdiff
path: root/src/dispnew.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-09-19 16:51:38 +0300
committerEli Zaretskii <eliz@gnu.org>2013-09-19 16:51:38 +0300
commit2fa833dafe89503e3444943a76206e056100e71a (patch)
tree0e41e753cb6e43a5e1208486199a412712b3b958 /src/dispnew.c
parent9e30f0e14eb8e1e03f69f57ac4d060a0ca6eedf7 (diff)
Fix a blatant bug in restore_current_matrix.
Diffstat (limited to 'src/dispnew.c')
-rw-r--r--src/dispnew.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index f1df96d75a..0a9ce116eb 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1971,7 +1971,7 @@ restore_current_matrix (struct frame *f, struct glyph_matrix *saved)
memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], nbytes);
to->used[TEXT_AREA] = from->used[TEXT_AREA];
xfree (from->glyphs[TEXT_AREA]);
- nbytes = from->used[LEFT_MARGIN_AREA];
+ nbytes = from->used[LEFT_MARGIN_AREA] * sizeof (struct glyph);
if (nbytes)
{
memcpy (to->glyphs[LEFT_MARGIN_AREA],
@@ -1981,7 +1981,7 @@ restore_current_matrix (struct frame *f, struct glyph_matrix *saved)
}
else
to->used[LEFT_MARGIN_AREA] = 0;
- nbytes = from->used[RIGHT_MARGIN_AREA];
+ nbytes = from->used[RIGHT_MARGIN_AREA] * sizeof (struct glyph);
if (nbytes)
{
memcpy (to->glyphs[RIGHT_MARGIN_AREA],