diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-11-10 08:15:19 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-11-10 08:15:19 +0000 |
commit | b9d3d9f726a79f0c1091e80cfb21e27eaed130c0 (patch) | |
tree | b4bffa1c2f8ab000bc31b745dfbfab91f6410c4d /misc/efgcvt_r.c | |
parent | 2864e767053317538feafa815046fff89e5a16be (diff) | |
download | glibc-b9d3d9f726a79f0c1091e80cfb21e27eaed130c0.tar glibc-b9d3d9f726a79f0c1091e80cfb21e27eaed130c0.tar.gz glibc-b9d3d9f726a79f0c1091e80cfb21e27eaed130c0.tar.bz2 glibc-b9d3d9f726a79f0c1091e80cfb21e27eaed130c0.zip |
Update.
1999-11-10 Andreas Jaeger <aj@suse.de>
* string/strsignal.c (strsignal): Correct check for snprintf
return value.
* argp/argp-fmtstream.c (__argp_fmtstream_printf): Likewise.
* misc/efgcvt_r.c (APPEND): Correct check for too small buffer
according to changed snprintf return value.
Reported by Lawrence K. Chen <lchen@opentext.com>.
* misc/tst-efgcvt.c (special): Add tests for a too small buffer
for ecvt_r and fcvt_r.
Diffstat (limited to 'misc/efgcvt_r.c')
-rw-r--r-- | misc/efgcvt_r.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/misc/efgcvt_r.c b/misc/efgcvt_r.c index 80770e6a82..1a039efc0b 100644 --- a/misc/efgcvt_r.c +++ b/misc/efgcvt_r.c @@ -101,7 +101,8 @@ APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign, buf, len) n = __snprintf (buf, len, "%.*" FLOAT_FMT_FLAG "f", MIN (ndigit, NDIGIT_MAX), value); - if (n < 0) + /* Check for a too small buffer. */ + if (n >= len) return -1; i = 0; |