diff options
| author | Paul Eggert | 2011-06-15 12:57:25 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-06-15 12:57:25 -0700 |
| commit | a7af7fdede602a111401c2352e81311a9dc38b99 (patch) | |
| tree | daebcb8a73345231337d0a461c01ae7804b2b646 /src/buffer.h | |
| parent | 8c9b210626493dd93f236d7fb312c4f6dba62892 (diff) | |
| parent | b1c46f026de9d185ba86ffb1b23c50f2bd095ccf (diff) | |
| download | emacs-a7af7fdede602a111401c2352e81311a9dc38b99.tar.gz emacs-a7af7fdede602a111401c2352e81311a9dc38b99.zip | |
Integer overflow and signedness fixes (Bug#8873).
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buffer.h b/src/buffer.h index 3540bd87cea..dc1d62beb00 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -338,7 +338,7 @@ while (0) | |||
| 338 | 338 | ||
| 339 | #define PTR_BYTE_POS(ptr) \ | 339 | #define PTR_BYTE_POS(ptr) \ |
| 340 | ((ptr) - (current_buffer)->text->beg \ | 340 | ((ptr) - (current_buffer)->text->beg \ |
| 341 | - (ptr - (current_buffer)->text->beg <= (unsigned) (GPT_BYTE - BEG_BYTE) ? 0 : GAP_SIZE) \ | 341 | - (ptr - (current_buffer)->text->beg <= GPT_BYTE - BEG_BYTE ? 0 : GAP_SIZE) \ |
| 342 | + BEG_BYTE) | 342 | + BEG_BYTE) |
| 343 | 343 | ||
| 344 | /* Return character at byte position POS. */ | 344 | /* Return character at byte position POS. */ |
| @@ -397,7 +397,7 @@ extern unsigned char *_fetch_multibyte_char_p; | |||
| 397 | 397 | ||
| 398 | #define BUF_PTR_BYTE_POS(buf, ptr) \ | 398 | #define BUF_PTR_BYTE_POS(buf, ptr) \ |
| 399 | ((ptr) - (buf)->text->beg \ | 399 | ((ptr) - (buf)->text->beg \ |
| 400 | - (ptr - (buf)->text->beg <= (unsigned) (BUF_GPT_BYTE ((buf)) - BEG_BYTE)\ | 400 | - (ptr - (buf)->text->beg <= BUF_GPT_BYTE (buf) - BEG_BYTE \ |
| 401 | ? 0 : BUF_GAP_SIZE ((buf))) \ | 401 | ? 0 : BUF_GAP_SIZE ((buf))) \ |
| 402 | + BEG_BYTE) | 402 | + BEG_BYTE) |
| 403 | 403 | ||