From 9903bf9ca82efda3370f2f172486ef6b585dc7fc Mon Sep 17 00:00:00 2001 From: nwanua Date: Fri, 27 Oct 2000 00:10:55 +0000 Subject: [PATCH] *** empty log message *** --- WINGs/wtext.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/WINGs/wtext.c b/WINGs/wtext.c index 521c6378..d6daff25 100644 --- a/WINGs/wtext.c +++ b/WINGs/wtext.c @@ -3076,7 +3076,6 @@ WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, unsigned short first, unsigned short extraInfo) { TextBlock *tb; - unsigned short len; if (!w || !description || !color) return NULL; @@ -3085,12 +3084,8 @@ WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, if (!tb) return NULL; - len = strlen(description)+1; - tb->text = (char *)wmalloc(len); - memset(tb->text, 0, len); - memcpy(tb->text, description, len); - tb->used = len; - tb->text[tb->used] = 0; + tb->text = wstrdup(description); + tb->used = strlen(description); tb->blank = False; tb->d.widget = w; tb->color = WMRetainColor(color); @@ -3118,7 +3113,6 @@ WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, unsigned short first, unsigned short extraInfo) { TextBlock *tb; - unsigned short len; if (!p || !description || !color) return NULL; @@ -3127,12 +3121,8 @@ WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, if (!tb) return NULL; - len = strlen(description)+1; - tb->text = (char *)wmalloc(len); - memset(tb->text, 0, len); - memcpy(tb->text, description, len); - tb->used = len; - tb->text[tb->used] = 0; + tb->text = wstrdup(description); + tb->used = strlen(description); tb->blank = False; tb->d.pixmap = WMRetainPixmap(p); tb->color = WMRetainColor(color);