diff options
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)) |