diff options
| author | Eli Zaretskii | 2016-01-15 17:36:47 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-01-15 17:36:47 +0200 |
| commit | 740849fe986b62a839bce4bbf67d0036fc1be0b9 (patch) | |
| tree | 04ae1b613906ff352e6ab12c4b113d23968f8ba5 /src | |
| parent | aa636c8465b03c09249dccd68fca3d1df04eaa2c (diff) | |
| download | emacs-740849fe986b62a839bce4bbf67d0036fc1be0b9.tar.gz emacs-740849fe986b62a839bce4bbf67d0036fc1be0b9.zip | |
Ensure positive number of glyphs for margins of positive width
* src/dispnew.c (margin_glyphs_to_reserve): Always return a
positive value when a non-zero width of the marginal area was
requested. (Bug#22356)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispnew.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 8d671f82e47..3e1557fa3b9 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -320,7 +320,9 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, int margin) | |||
| 320 | int width = w->total_cols; | 320 | int width = w->total_cols; |
| 321 | double d = max (0, margin); | 321 | double d = max (0, margin); |
| 322 | d = min (width / 2 - 1, d); | 322 | d = min (width / 2 - 1, d); |
| 323 | return (int) ((double) total_glyphs / width * d); | 323 | /* Since MARGIN is positive, we cannot possibly have less than |
| 324 | one glyph for the marginal area. */ | ||
| 325 | return max (1, (int) ((double) total_glyphs / width * d)); | ||
| 324 | } | 326 | } |
| 325 | return 0; | 327 | return 0; |
| 326 | } | 328 | } |