diff options
| author | Richard M. Stallman | 1995-08-07 17:52:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-08-07 17:52:16 +0000 |
| commit | 6e9517285f9cc9bafec534bc3198cc0e099978bc (patch) | |
| tree | 4764dcccf54ca8aaac46cf50b3462b3bae8542eb /src | |
| parent | a7e9dc1d14b9f1af284deba0555b1ebfdee08d31 (diff) | |
| download | emacs-6e9517285f9cc9bafec534bc3198cc0e099978bc.tar.gz emacs-6e9517285f9cc9bafec534bc3198cc0e099978bc.zip | |
(doprnt): Don't let size_bound be gigantic. Fix error message.
Diffstat (limited to 'src')
| -rw-r--r-- | src/doprnt.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/doprnt.c b/src/doprnt.c index 24eea1e70f6..63f724cf7a7 100644 --- a/src/doprnt.c +++ b/src/doprnt.c | |||
| @@ -104,6 +104,11 @@ doprnt (buffer, bufsize, format, format_end, nargs, args) | |||
| 104 | size_bound = -size_bound; | 104 | size_bound = -size_bound; |
| 105 | size_bound += 50; | 105 | size_bound += 50; |
| 106 | 106 | ||
| 107 | if (size_bound > bufsize) | ||
| 108 | /* This is certainly enough that it doesn't matter | ||
| 109 | to lose the rest. */ | ||
| 110 | size_bound = bufsize + 100; | ||
| 111 | |||
| 107 | /* Make sure we have that much. */ | 112 | /* Make sure we have that much. */ |
| 108 | if (size_bound > size_allocated) | 113 | if (size_bound > size_allocated) |
| 109 | { | 114 | { |
| @@ -125,7 +130,7 @@ doprnt (buffer, bufsize, format, format_end, nargs, args) | |||
| 125 | case 'o': | 130 | case 'o': |
| 126 | case 'x': | 131 | case 'x': |
| 127 | if (cnt == nargs) | 132 | if (cnt == nargs) |
| 128 | error ("not enough arguments for format string"); | 133 | error ("Not enough arguments for format string"); |
| 129 | if (sizeof (int) == sizeof (EMACS_INT)) | 134 | if (sizeof (int) == sizeof (EMACS_INT)) |
| 130 | ; | 135 | ; |
| 131 | else if (sizeof (long) == sizeof (EMACS_INT)) | 136 | else if (sizeof (long) == sizeof (EMACS_INT)) |