aboutsummaryrefslogtreecommitdiffstats
path: root/epan/emem.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2006-01-11 02:05:05 +0000
committerGerald Combs <gerald@wireshark.org>2006-01-11 02:05:05 +0000
commit6d3b121deb3a1d2e3e2fab2387f88f48d995e046 (patch)
tree700c6d65817cc794416e372d4081b18fdfc609c8 /epan/emem.c
parent34f4ff7baeb596d7e64e1a99813fa2eb8ad15852 (diff)
Fix compiling under GLib 1, squelch a gcc warning.
svn path=/trunk/; revision=16998
Diffstat (limited to 'epan/emem.c')
-rw-r--r--epan/emem.c8
1 files changed, 5 insertions, 3 deletions
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;