aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-04-28 13:27:52 -0700
committerPaul Eggert2011-04-28 13:27:52 -0700
commitca2d6274770983cbbe5cf087c5e74872c6941c6a (patch)
tree492a7cd716cb102e9e6020fa41b4c0777e131243 /src
parent283cdbef2afe17fc83d93886ac8c47c5222c4ee2 (diff)
downloademacs-ca2d6274770983cbbe5cf087c5e74872c6941c6a.tar.gz
emacs-ca2d6274770983cbbe5cf087c5e74872c6941c6a.zip
Improve comment.
Diffstat (limited to 'src')
-rw-r--r--src/doprnt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/doprnt.c b/src/doprnt.c
index db0b66c3aa2..22950ec6fad 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -199,11 +199,11 @@ doprnt (char *buffer, register size_t bufsize, const char *format,
199 while (fmt < format_end 199 while (fmt < format_end
200 && '0' <= fmt[1] && fmt[1] <= '9') 200 && '0' <= fmt[1] && fmt[1] <= '9')
201 { 201 {
202 /* Avoid int overflow, because many sprintfs seriously 202 /* Avoid size_t overflow. Avoid int overflow too, as
203 mess up with widths or precisions greater than 203 many sprintfs mishandle widths greater than INT_MAX.
204 INT_MAX. Avoid size_t overflow, since our counters 204 This test is simple but slightly conservative: e.g.,
205 use size_t. This test is slightly conservative, for 205 (INT_MAX - INT_MAX % 10) is reported as an overflow
206 speed and simplicity. */ 206 even when it's not. */
207 if (n >= min (INT_MAX, SIZE_MAX) / 10) 207 if (n >= min (INT_MAX, SIZE_MAX) / 10)
208 error ("Format width or precision too large"); 208 error ("Format width or precision too large");
209 n = n * 10 + fmt[1] - '0'; 209 n = n * 10 + fmt[1] - '0';