From 272e57235cd60a2e65ac8258d96a02eb3939b687 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 25 Mar 2011 10:41:05 +0000 Subject: git update until 25 Mar 2011 xserver fontconfig glproto libXau libXft libXmu libfontenc libxcb mesa mkfontscale pixman randrproto xkeyboard-config xtrans xwininfo updated following packages: xproto-7.0.21 xineramaproto-1.2.1 libXt-1.1.1 libxkbfile-1.0.7 libXpm-3.5.9 libXfont-1.4.3 libXaw-1.0.9 bdftopcf-1.0.3 encodings-1.0.4 fixesproto-5.0 font-adobe-100dpi-1.0.3 font-adobe-75dpi-1.0.3 font-adobe-utopia-100dpi-1.0.4 font-adobe-utopia-75dpi-1.0.4 font-adobe-utopia-type1-1.0.4 font-alias-1.0.3 font-arabic-misc-1.0.3 font-bh-100dpi-1.0.3 font-bh-75dpi-1.0.3 font-bh-lucidatypewriter-100dpi-1.0.3 font-bh-lucidatypewriter-75dpi-1.0.3 font-bh-ttf-1.0.3 font-bh-type1-1.0.3 font-bitstream-100dpi-1.0.3 font-bitstream-75dpi-1.0.3 font-bitstream-speedo-1.0.2 font-bitstream-type1-1.0.3 font-cronyx-cyrillic-1.0.3 font-cursor-misc-1.0.3 font-daewoo-misc-1.0.3 font-dec-misc-1.0.3 font-ibm-type1-1.0.3 font-isas-misc-1.0.3 font-jis-misc-1.0.3 font-micro-misc-1.0.3 font-misc-cyrillic-1.0.3 font-misc-ethiopic-1.0.3 font-misc-meltho-1.0.3 font-misc-misc-1.1.2 font-mutt-misc-1.0.3 font-schumacher-misc-1.1.2 font-screen-cyrillic-1.0.4 font-sony-misc-1.0.3 font-sun-misc-1.0.3 font-util-1.2.0 font-winitzki-cyrillic-1.0.3 font-xfree86-type1-1.0.4 --- libXt/src/ResConfig.c | 44 ++++++++++---------------------------------- 1 file changed, 10 insertions(+), 34 deletions(-) (limited to 'libXt/src/ResConfig.c') diff --git a/libXt/src/ResConfig.c b/libXt/src/ResConfig.c index fd6d057c9..68da5364c 100644 --- a/libXt/src/ResConfig.c +++ b/libXt/src/ResConfig.c @@ -1,4 +1,3 @@ -/* $Xorg: ResConfig.c,v 1.5 2001/02/09 02:03:56 xorgcvs Exp $ */ /* Copyright 1987, 1988, 1998 The Open Group @@ -52,7 +51,6 @@ dealings in this Software without prior written authorization from the IBM Corporation. ******************************************************************/ -/* $XFree86: xc/lib/Xt/ResConfig.c,v 3.7 2001/08/22 22:52:19 dawes Exp $ */ #ifdef HAVE_CONFIG_H #include @@ -176,18 +174,13 @@ _set_resource_values ( * create resource name string */ if (resource_name) { - temp = XtMalloc (sizeof(char) * - (2 + strlen(cur->core.name) - + strlen(resource_name))); - sprintf (temp, ".%s%s", cur->core.name, resource_name); + XtAsprintf (&temp, ".%s%s", cur->core.name, resource_name); XtFree (resource_name); } else if (!XtIsWidget (cur) || !cur->core.name) { cur = XtParent(cur); continue; } else { - temp = XtMalloc (sizeof(char) * - (2 + strlen(cur->core.name))); - sprintf (temp, ".%s", cur->core.name); + XtAsprintf (&temp, ".%s", cur->core.name); } resource_name = temp; @@ -199,31 +192,19 @@ _set_resource_values ( (ApplicationShellWidget) (cur); if (resource_class) { - temp = XtMalloc (sizeof(char) * - (2 + strlen(top->application.class) - + strlen(resource_class))); - sprintf (temp, ".%s%s", + XtAsprintf (&temp, ".%s%s", top->application.class, resource_class); } else { - temp = XtMalloc (sizeof(char) * - (2 + strlen(top->application.class))); - sprintf (temp, ".%s", + XtAsprintf (&temp, ".%s", top->application.class); } } else { if (resource_class) { - temp = XtMalloc (sizeof(char) * - (2 + strlen( - cur->core.widget_class->core_class.class_name) - + strlen(resource_class))); - sprintf (temp, ".%s%s", + XtAsprintf (&temp, ".%s%s", cur->core.widget_class->core_class.class_name, resource_class); } else { - temp = XtMalloc (sizeof(char) * - (2 + strlen( - cur->core.widget_class->core_class.class_name))); - sprintf (temp, ".%s", + XtAsprintf (&temp, ".%s", cur->core.widget_class->core_class.class_name); } } @@ -237,9 +218,7 @@ _set_resource_values ( /* * add the resource name to the end of the resource name string */ - temp = XtMalloc (2 + strlen(resource_name) + - strlen(resources_return[res_index].resource_name)); - sprintf (temp, "%s.%s", resource_name, + XtAsprintf (&temp, "%s.%s", resource_name, resources_return[res_index].resource_name); if (resource_name != NULL) XtFree (resource_name); @@ -248,9 +227,7 @@ _set_resource_values ( /* * add the resource class to the end of the resource class string */ - temp = XtMalloc (2 + strlen(resource_class) + - strlen(resources_return[res_index].resource_class)); - sprintf (temp, "%s.%s", resource_class, + XtAsprintf (&temp, "%s.%s", resource_class, resources_return[res_index].resource_class); if (resource_class != NULL) XtFree (resource_class); @@ -748,7 +725,7 @@ _search_widget_tree ( /* * this case covers resources of only one level (eg. *background) */ - if (strcmp (remainder, "") == 0) { + if (remainder[0] == 0) { _set_resource_values (w, resource, value, last_part); if (last_token == '*') _apply_values_to_children (parent, remainder, resource, @@ -759,8 +736,7 @@ _search_widget_tree ( */ } else { if (remainder[0] != '*' && remainder[0] != '.') { - copy = XtMalloc (strlen(remainder) + 2); - sprintf (copy, ".%s", remainder); + XtAsprintf (©, ".%s", remainder); XtFree (remainder); remainder = copy; } -- cgit v1.2.3