]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(APPEND): Correct check for too small buffer according to changed snprintf return...
authorUlrich Drepper <drepper@redhat.com>
Wed, 10 Nov 1999 08:13:51 +0000 (08:13 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 10 Nov 1999 08:13:51 +0000 (08:13 +0000)
misc/efgcvt_r.c

index 80770e6a82765e4e5f1b4fc1f5586b1cb574e20c..1a039efc0bdc721139fc1f2802faff9bcffd667c 100644 (file)
@@ -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;