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.c | |
| 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.c')
| -rw-r--r-- | src/buffer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buffer.c b/src/buffer.c index 7030fea1002..d7adf63c98b 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -850,8 +850,8 @@ it is in the sequence to be tried) even if a buffer with that name exists. */) | |||
| 850 | (register Lisp_Object name, Lisp_Object ignore) | 850 | (register Lisp_Object name, Lisp_Object ignore) |
| 851 | { | 851 | { |
| 852 | register Lisp_Object gentemp, tem; | 852 | register Lisp_Object gentemp, tem; |
| 853 | int count; | 853 | EMACS_INT count; |
| 854 | char number[10]; | 854 | char number[INT_BUFSIZE_BOUND (EMACS_INT) + sizeof "<>"]; |
| 855 | 855 | ||
| 856 | CHECK_STRING (name); | 856 | CHECK_STRING (name); |
| 857 | 857 | ||
| @@ -865,7 +865,7 @@ it is in the sequence to be tried) even if a buffer with that name exists. */) | |||
| 865 | count = 1; | 865 | count = 1; |
| 866 | while (1) | 866 | while (1) |
| 867 | { | 867 | { |
| 868 | sprintf (number, "<%d>", ++count); | 868 | sprintf (number, "<%"pI"d>", ++count); |
| 869 | gentemp = concat2 (name, build_string (number)); | 869 | gentemp = concat2 (name, build_string (number)); |
| 870 | tem = Fstring_equal (gentemp, ignore); | 870 | tem = Fstring_equal (gentemp, ignore); |
| 871 | if (!NILP (tem)) | 871 | if (!NILP (tem)) |
| @@ -1969,7 +1969,7 @@ validate_region (register Lisp_Object *b, register Lisp_Object *e) | |||
| 1969 | /* Advance BYTE_POS up to a character boundary | 1969 | /* Advance BYTE_POS up to a character boundary |
| 1970 | and return the adjusted position. */ | 1970 | and return the adjusted position. */ |
| 1971 | 1971 | ||
| 1972 | static int | 1972 | static EMACS_INT |
| 1973 | advance_to_char_boundary (EMACS_INT byte_pos) | 1973 | advance_to_char_boundary (EMACS_INT byte_pos) |
| 1974 | { | 1974 | { |
| 1975 | int c; | 1975 | int c; |