ShortFloat.st
changeset 21950 f5852ca02a75
parent 21906 f070c75710f1
child 21955 c6b82cbb4b6a
--- a/ShortFloat.st	Mon Jul 03 15:13:20 2017 +0200
+++ b/ShortFloat.st	Mon Jul 03 15:13:26 2017 +0200
@@ -1484,9 +1484,8 @@
 printfPrintString:formatString
     "non-standard: return a printed representation of the receiver
      as specified by formatString, which is defined by printf.
-     If you use this, be aware, that specifying doubles differs on
-     systems; on SYSV machines you have to give something like %lf,
-     while on BSD systems the format string has to be %F.
+
+     If you use this, be aware, that the format string must be correct and something like %f.
      Also, the resulting string may not be longer than 255 bytes -
      since that's the (static) size of the buffer.
 
@@ -1512,6 +1511,7 @@
         __END_PROTECT_REGISTERS__
 
         if (len < 0) goto fail;
+        if (len >= sizeof(buffer)) goto fail;
 
         s = __MKSTRING_L(buffer, len);
         if (s != nil) {
@@ -1530,7 +1530,7 @@
     "ShortFloat pi printfPrintString:'%%7.5G -> %7.5G'"
     "ShortFloat pi printfPrintString:'%%7.5F -> %7.5F'"
 
-    "Modified (comment): / 22-06-2017 / 13:56:15 / cg"
+    "Modified (comment): / 03-07-2017 / 15:12:20 / cg"
 !
 
 storeString