[Xfce4-commits] <xfce4-dict:master> Make the code more readable

Enrico Tröger noreply at xfce.org
Mon Jan 3 01:12:04 CET 2011


Updating branch refs/heads/master
         to 6aa6ae683341c307f8497587d3570d91f12a24ad (commit)
       from aef72cd999786bcc19d473bf6e3a97b802574189 (commit)

commit 6aa6ae683341c307f8497587d3570d91f12a24ad
Author: Enrico Tröger <enrico.troeger at uvena.de>
Date:   Mon Jan 3 00:53:16 2011 +0100

    Make the code more readable

 lib/dictd.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/dictd.c b/lib/dictd.c
index a9de054..8a52686 100644
--- a/lib/dictd.c
+++ b/lib/dictd.c
@@ -584,6 +584,7 @@ static gpointer ask_server(DictData *dd)
 {
 	gint fd, i;
 	static gchar cmd[BUF_SIZE];
+	gchar *tmp_buf;
 
 	if ((fd = open_socket(dd->server, dd->port)) == -1)
 	{
@@ -595,12 +596,14 @@ static gpointer ask_server(DictData *dd)
 	dd->query_is_running = TRUE;
 	dd->query_status = NO_CONNECTION;
 
-	g_free(get_answer(dd, fd));
+	tmp_buf = get_answer(dd, fd);
+	g_free(tmp_buf);
 	if (dd->query_status == NO_ERROR)
 	{
 		/* take only the first part of the dictionary string, so let the string end at the space */
 		i = 0;
-		while (dd->dictionary[i] != ' ') i++;
+		while (dd->dictionary[i] != ' ')
+			i++;
 		dd->dictionary[i] = '\0';
 
 		g_snprintf(cmd, BUF_SIZE, "DEFINE %s \"%s\"", dd->dictionary, dd->searched_word);



More information about the Xfce4-commits mailing list