From 5877c73c0b502e60e42a9e1232c1fa03427b6dcc Mon Sep 17 00:00:00 2001 From: sewardj Date: Tue, 7 Mar 2000 09:34:43 +0000 Subject: [PATCH] [project @ 2000-03-07 09:34:43 by sewardj] Properly fix a sprintf bug in typeInstDefn(). --- ghc/interpreter/type.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ghc/interpreter/type.c b/ghc/interpreter/type.c index 1958b04..744597a 100644 --- a/ghc/interpreter/type.c +++ b/ghc/interpreter/type.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: type.c,v $ - * $Revision: 1.26 $ - * $Date: 2000/03/07 07:27:11 $ + * $Revision: 1.27 $ + * $Date: 2000/03/07 09:34:43 $ * ------------------------------------------------------------------------*/ #include "prelude.h" @@ -1963,6 +1963,7 @@ Inst in; { /* member functions for instance in*/ /* Invent a GHC-compatible name for the instance decl */ { char buf[FILENAME_MAX+1]; + char buf2[10]; Int i, j; String str; Cell qq = inst(in).head; @@ -1989,7 +1990,9 @@ Inst in; { /* member functions for instance in*/ switch (whatIs(qq)) { case TYCON: str = textToStr(tycon(qq).text); break; case TUPLE: str = textToStr(ghcTupleText(qq)); break; - case OFFSET: sprintf(&str,"%d",offsetOf(qq)); break; + case OFFSET: sprintf(buf2,"%d",offsetOf(qq)); + str = buf2; + break; default: internal("typeInstDefn: making GHC name"); break; } for (j = 0; i