[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r5125 - gnunet-gtk/src/plugins/peers
From: |
gnunet |
Subject: |
[GNUnet-SVN] r5125 - gnunet-gtk/src/plugins/peers |
Date: |
Fri, 22 Jun 2007 03:39:25 -0600 (MDT) |
Author: grothoff
Date: 2007-06-22 03:39:24 -0600 (Fri, 22 Jun 2007)
New Revision: 5125
Modified:
gnunet-gtk/src/plugins/peers/peers.c
Log:
fix
Modified: gnunet-gtk/src/plugins/peers/peers.c
===================================================================
--- gnunet-gtk/src/plugins/peers/peers.c 2007-06-22 09:39:23 UTC (rev
5124)
+++ gnunet-gtk/src/plugins/peers/peers.c 2007-06-22 09:39:24 UTC (rev
5125)
@@ -105,48 +105,46 @@
addr_len,
YES);
if (hostname == NULL)
- hostname = "NAT";
+ hostname = STRDUP("NAT");
/* get flag */
flagBuf = NULL;
ledBuf = NULL;
cc = NULL;
- if (hostname != NULL) {
- prefix = STRDUP(hostname);
- if (strstr(prefix, " ") != NULL)
- *strstr(prefix, " ") = '\0';
- cc = prefix;
- while (strstr(cc, ".") != NULL)
- cc = strstr(cc, ".") + 1;
- if (strstr(hostname, ".") == NULL)
- cc = NULL;
- else if ( (0 == strcmp(cc, "edu")) ||
- (0 == strcmp(cc, "com")) ||
- (0 == strcmp(cc, "net")) ||
- (0 == strcmp(cc, "org")) ||
- (0 == strcmp(cc, "gov")) ||
- (0 == strcmp(cc, "mil")) )
- cc = "us";
- if ( (cc != NULL) &&
- (strlen(cc) > 2) )
- cc = NULL;
- if (cc != NULL) {
- cc = STRDUP(cc);
- dir = os_get_installation_path(IPK_DATADIR);
- fn = MALLOC(strlen(dir) + 32);
- strcpy(fn, dir);
- strcat(fn,
- DIR_SEPARATOR_STR ".."
- DIR_SEPARATOR_STR "gnunet-gtk"
- DIR_SEPARATOR_STR "flags"
- DIR_SEPARATOR_STR);
- strcat(fn, cc);
- strcat(fn, ".png");
- FREE(dir);
- flagBuf = gdk_pixbuf_new_from_file(fn, NULL);
- FREE(fn);
- }
- FREE(prefix);
+ prefix = STRDUP(hostname);
+ if (strstr(prefix, " ") != NULL)
+ *strstr(prefix, " ") = '\0';
+ cc = prefix;
+ while (strstr(cc, ".") != NULL)
+ cc = strstr(cc, ".") + 1;
+ if (strstr(hostname, ".") == NULL)
+ cc = NULL;
+ else if ( (0 == strcmp(cc, "edu")) ||
+ (0 == strcmp(cc, "com")) ||
+ (0 == strcmp(cc, "net")) ||
+ (0 == strcmp(cc, "org")) ||
+ (0 == strcmp(cc, "gov")) ||
+ (0 == strcmp(cc, "mil")) )
+ cc = "us";
+ if ( (cc != NULL) &&
+ (strlen(cc) > 2) )
+ cc = NULL;
+ if (cc != NULL) {
+ cc = STRDUP(cc);
+ dir = os_get_installation_path(IPK_DATADIR);
+ fn = MALLOC(strlen(dir) + 32);
+ strcpy(fn, dir);
+ strcat(fn,
+ DIR_SEPARATOR_STR ".."
+ DIR_SEPARATOR_STR "gnunet-gtk"
+ DIR_SEPARATOR_STR "flags"
+ DIR_SEPARATOR_STR);
+ strcat(fn, cc);
+ strcat(fn, ".png");
+ FREE(dir);
+ flagBuf = gdk_pixbuf_new_from_file(fn, NULL);
+ FREE(fn);
}
+ FREE(prefix);
/* get LED */
now = get_time();
@@ -177,6 +175,7 @@
7, last_message,
-1);
FREENONNULL(cc);
+ FREE(hostname);
return OK;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r5125 - gnunet-gtk/src/plugins/peers,
gnunet <=