From c4863e589dd194b3a0d0144538f9670b96810e41 Mon Sep 17 00:00:00 2001 From: frese Date: Wed, 19 Jun 2002 08:35:23 +0000 Subject: [PATCH] - fixed some small bugs in scx_set_after_function and scx_extents_text. --- c/xlib/display.c | 1 + c/xlib/text.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/c/xlib/display.c b/c/xlib/display.c index 1809f12..1806d1d 100644 --- a/c/xlib/display.c +++ b/c/xlib/display.c @@ -34,6 +34,7 @@ s48_value scx_Set_After_Function(s48_value Xdisplay, s48_value active) { else (void)XSetAfterFunction(SCX_EXTRACT_DISPLAY(Xdisplay), X_After_Function); + return S48_UNSPECIFIC; } // This function returns the file destriptor of the message-channel. diff --git a/c/xlib/text.c b/c/xlib/text.c index 88db1bc..e7877c3 100644 --- a/c/xlib/text.c +++ b/c/xlib/text.c @@ -37,11 +37,12 @@ s48_value scx_Text_Width(s48_value Xfontstruct, s48_value text, s48_value scx_Extents_Text (s48_value Xfontstruct, s48_value text, s48_value format, s48_value which){ - char* s; - XChar2b* s2; + int len = (int)S48_VECTOR_LENGTH(text) + char s[len]; + XChar2b s2[len]; XFontStruct* font = SCX_EXTRACT_FONTSTRUCT(Xfontstruct); XCharStruct CI; - int len = (int)S48_VECTOR_LENGTH(text), i, tmp, dir, fasc, fdesc; + int i, tmp, dir, fasc, fdesc; if (s48_extract_integer(format) == 1){ for (i = 0; i < len; i++){ tmp = (int)s48_extract_integer(S48_VECTOR_REF(text, i));