--- a/String.st Sat Jan 08 17:18:40 1994 +0100
+++ b/String.st Sat Jan 08 17:24:16 1994 +0100
@@ -22,7 +22,7 @@
COPYRIGHT (c) 1988 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/String.st,v 1.6 1993-12-11 00:58:18 claus Exp $
+$Header: /cvs/stx/stx/libbasic/String.st,v 1.7 1994-01-08 16:24:02 claus Exp $
'!
%{
@@ -340,24 +340,25 @@
which is defined by printf.
No checking on overrunning the buffer."
-%{ /* STACK: 4000 */
+%{ /* STACK: 1000 */
- char buffer[3900];
+ char buffer[800];
char *cp;
if (_isString(formatString)) {
-#ifdef THISCONTEXT_IN_REGISTER
- /* mhmh - sprintf seems to destroy thisContext (if its in a register) */
+ /*
+ * actually only needed on sparc: since thisContext is
+ * in a global register, which gets destroyed by printf,
+ * manually save it here - very stupid ...
+ */
OBJ sav = __thisContext;
-#endif
+
cp = (char *)_stringVal(self);
if (_qClass(self) != String)
cp += _intVal(_ClassInstPtr(_qClass(self))->c_ninstvars) * sizeof(OBJ);
sprintf(buffer, (char *)_stringVal(formatString), cp);
-#ifdef THISCONTEXT_IN_REGISTER
__thisContext = sav;
-#endif
RETURN ( _MKSTRING(buffer COMMA_SND) );
}
%}