summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-06-11 22:33:24 +0000
committerChristian Grothoff <christian@grothoff.org>2010-06-11 22:33:24 +0000
commit464d2cbfa3c56bd11c78667fc6e2f0a960f02f92 (patch)
tree0d5ffb0a36890fc58bf1b53b4ef872c8f5f68279 /src
parent4094407e04c6cfc3b944301467f1249cdc59954c (diff)
downloadgnunet-464d2cbfa3c56bd11c78667fc6e2f0a960f02f92.tar.gz
gnunet-464d2cbfa3c56bd11c78667fc6e2f0a960f02f92.zip
minor fixes
Diffstat (limited to 'src')
-rw-r--r--src/hostlist/hostlist-server.c16
-rw-r--r--src/include/platform.h4
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c4
-rw-r--r--src/testing/testing_group.c2
-rw-r--r--src/util/strings.c2
5 files changed, 20 insertions, 8 deletions
diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c
index 055c90bab..8d4d38d09 100644
--- a/src/hostlist/hostlist-server.c
+++ b/src/hostlist/hostlist-server.c
@@ -597,11 +597,19 @@ GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c,
597 _("Could not access PEERINFO service. Exiting.\n")); 597 _("Could not access PEERINFO service. Exiting.\n"));
598 return GNUNET_SYSERR; 598 return GNUNET_SYSERR;
599 } 599 }
600 if (-1 == GNUNET_CONFIGURATION_get_value_number (cfg, 600 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (cfg,
601 "HOSTLIST", 601 "HOSTLIST",
602 "HTTPPORT", 602 "HTTPPORT",
603 &port)) 603 &port))
604 return GNUNET_SYSERR; 604 return GNUNET_SYSERR;
605 if ( (port == 0) ||
606 (port > UINT16_MAX) )
607 {
608 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
609 _("Invalid port number %llu. Exiting.\n"),
610 port);
611 return GNUNET_SYSERR;
612 }
605 613
606 if ( GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (cfg, 614 if ( GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (cfg,
607 "HOSTLIST", 615 "HOSTLIST",
diff --git a/src/include/platform.h b/src/include/platform.h
index fb9c992ec..7a974b48d 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -214,6 +214,10 @@ long long atoll (const char *nptr);
214#include "langinfo.h" 214#include "langinfo.h"
215#endif 215#endif
216 216
217#ifndef SIZE_MAX
218#define SIZE_MAX ((size_t)(-1))
219#endif
220
217#ifndef O_LARGEFILE 221#ifndef O_LARGEFILE
218#define O_LARGEFILE 0 222#define O_LARGEFILE 0
219#endif 223#endif
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index e8ac5ef4a..7c1f53d4b 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -329,8 +329,8 @@ change_host_trust (const struct GNUNET_PeerIdentity *hostId, int value)
329 { 329 {
330 if (host->trust + value < host->trust) 330 if (host->trust + value < host->trust)
331 { 331 {
332 value = ((uint32_t) - 1) - host->trust; 332 value = UINT32_MAX - host->trust;
333 host->trust = (uint32_t) - 1; /* maximized */ 333 host->trust = UINT32_MAX;
334 } 334 }
335 else 335 else
336 host->trust += value; 336 host->trust += value;
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c
index 4f369812d..f4057e6d1 100644
--- a/src/testing/testing_group.c
+++ b/src/testing/testing_group.c
@@ -1488,7 +1488,7 @@ create_and_copy_blacklist_files (struct GNUNET_TESTING_PeerGroup *pg, char *tran
1488 } 1488 }
1489 } 1489 }
1490 1490
1491 GNUNET_free_non_null(temp_transports); 1491 GNUNET_free (temp_transports);
1492 fclose(temp_file_handle); 1492 fclose(temp_file_handle);
1493 1493
1494 if (GNUNET_OK != 1494 if (GNUNET_OK !=
diff --git a/src/util/strings.c b/src/util/strings.c
index c868d1a97..1f7f45d51 100644
--- a/src/util/strings.c
+++ b/src/util/strings.c
@@ -204,7 +204,7 @@ GNUNET_STRINGS_to_utf8 (const char *input, size_t len, const char *charset)
204#else 204#else
205 (char **) &input, 205 (char **) &input,
206#endif 206#endif
207 &len, &itmp, &finSize) == (size_t) - 1) 207 &len, &itmp, &finSize) == SIZE_MAX)
208 { 208 {
209 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "iconv"); 209 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "iconv");
210 iconv_close (cd); 210 iconv_close (cd);