Commits

Akira TAGOH committed 9c66a0f

Fix erronerous code

Comments (0)

Files changed (4)

libgxim/gximcltmpl.c

 	if (prop)
 		p = g_strndup(prop, bytes);
 	error_code = g_xim_error_pop();
-	if (error_code != 0) {
+	if (!p || error_code != 0) {
 		gchar *s = gdk_atom_name(event->property);
 
 		g_xim_messages_critical(core->message,

libgxim/gximmisc.c

 		type2pos[G_XIM_TYPE_LIST_OF_HOTKEY_TRIGGER] = 555;
 	}
 
-	if (vtype > LAST_VALUE_TYPE ||
+	if (vtype >= LAST_VALUE_TYPE ||
 	    type2pos[vtype] == 0) {
 		snprintf(tmp, 255, "0x%x", vtype);
 
 	if (list->n_nodes == list->allocated_len) {
 		gpointer data;
 
-		data = g_realloc(list->nodes,
-				 sizeof (gpointer) * (list->allocated_len + N_REALLOC_NESTED_LIST));
+		data = (gpointer)g_realloc(list->nodes,
+					   sizeof (gpointer) * (list->allocated_len + N_REALLOC_NESTED_LIST));
 		G_XIM_CHECK_ALLOC (data, FALSE);
 
 		list->nodes = data;

libgxim/gximprotocol.c

 	g_return_val_if_fail (closure != NULL, FALSE);
 	g_return_val_if_fail (closure->signal_marshaller != NULL, FALSE);
 
-	va_start(ap, proto);
-
 	g_value_init(&v, G_TYPE_BOOLEAN);
 	pv = g_new0(GValue, closure->n_params + 1);
 	G_XIM_CHECK_ALLOC (pv, FALSE);
 	g_value_init(&pv[0], G_TYPE_OBJECT);
 	g_value_set_object(&pv[0], proto);
 
+	va_start(ap, proto);
+
 	for (i = 0; i < closure->n_params; i++) {
 		if (g_type_is_a(closure->param_types[i], G_TYPE_OBJECT))
 			g_value_init(&pv[i + 1], G_TYPE_OBJECT);

libgxim/gximprotocol10.c

 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
+#include <gdk/gdkkeysyms.h>
 #include <gio/gio.h>
 #include "gximattr.h"
 #include "gximconnection.h"
 	gboolean retval = FALSE;
 	guint16 imid = 0, icid = 0, flag = 0;
 	gint padding = 0;
-	guint32 keysym;
+	guint32 keysym = GDK_KEY_VoidSymbol;
 	GString *string = NULL;
 
 	if (!g_xim_protocol_read_format(proto, stream, NULL, error, 3,