From 6d3b121deb3a1d2e3e2fab2387f88f48d995e046 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Wed, 11 Jan 2006 02:05:05 +0000 Subject: Fix compiling under GLib 1, squelch a gcc warning. svn path=/trunk/; revision=16998 --- epan/emem.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'epan') diff --git a/epan/emem.c b/epan/emem.c index b7936e181a..3323c5d7ef 100644 --- a/epan/emem.c +++ b/epan/emem.c @@ -110,8 +110,8 @@ emem_canary(guint8 *canary) { FILE *fp; size_t sz; /* Try /dev/urandom */ - if (fp = eth_fopen("/dev/urandom", 0)) { - sz = fread(canary, EMEM_CANARY_DATA_SIZE, 1, fd); + if ((fp = eth_fopen("/dev/urandom", 0)) != NULL) { + sz = fread(canary, EMEM_CANARY_DATA_SIZE, 1, fp); fclose(fp); if (sz == EMEM_CANARY_SIZE) { return; @@ -131,7 +131,7 @@ emem_canary(guint8 *canary) { * Given an allocation size, return the amount of padding needed for * the canary value. */ -guint8 +static guint8 emem_canary_pad (size_t allocation) { guint8 pad; @@ -524,6 +524,7 @@ ep_free_all(void) while (npc != NULL) { #ifndef EP_DEBUG_FREE for (i = 0; i < npc->c_count; i++) { + /* XXX - This isn't very graceful */ g_assert(memcmp(npc->canary[i], &ep_canary, npc->cmp_len[i]) == 0); } npc->c_count = 0; @@ -564,6 +565,7 @@ se_free_all(void) while (npc != NULL) { #ifndef SE_DEBUG_FREE for (i = 0; i < npc->c_count; i++) { + /* XXX - This isn't very graceful */ g_assert(memcmp(npc->canary[i], &se_canary, npc->cmp_len[i]) == 0); } npc->c_count = 0; -- cgit v1.2.3