diff options
| author | Richard M. Stallman | 1997-08-18 18:56:07 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-08-18 18:56:07 +0000 |
| commit | 20713324f5dd5ea000b99a46e70b4378a1521f2b (patch) | |
| tree | 0b337ac4262943e15ae80815e82042f057c44b36 /src | |
| parent | af4fecb4083fcdda3071d3a1f43d84dc4cf29e64 (diff) | |
| download | emacs-20713324f5dd5ea000b99a46e70b4378a1521f2b.tar.gz emacs-20713324f5dd5ea000b99a46e70b4378a1521f2b.zip | |
(Fchar_before): Do range check before decrement.
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/editfns.c b/src/editfns.c index c8a6506e493..c12ea5ac3bb 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -610,18 +610,17 @@ is returned as a character.") | |||
| 610 | n = XINT (pos); | 610 | n = XINT (pos); |
| 611 | } | 611 | } |
| 612 | 612 | ||
| 613 | if (n <= BEGV || n > ZV) | ||
| 614 | return Qnil; | ||
| 615 | |||
| 613 | if (!NILP (current_buffer->enable_multibyte_characters)) | 616 | if (!NILP (current_buffer->enable_multibyte_characters)) |
| 614 | { | 617 | { |
| 615 | DEC_POS (n); | 618 | DEC_POS (n); |
| 616 | if (n < BEGV || n >= ZV) | ||
| 617 | return Qnil; | ||
| 618 | XSETFASTINT (val, FETCH_CHAR (n)); | 619 | XSETFASTINT (val, FETCH_CHAR (n)); |
| 619 | } | 620 | } |
| 620 | else | 621 | else |
| 621 | { | 622 | { |
| 622 | n--; | 623 | n--; |
| 623 | if (n < BEGV || n >= ZV) | ||
| 624 | return Qnil; | ||
| 625 | XSETFASTINT (val, FETCH_BYTE (n)); | 624 | XSETFASTINT (val, FETCH_BYTE (n)); |
| 626 | } | 625 | } |
| 627 | return val; | 626 | return val; |