Browse Source

talloc: avoid a comparison mismatch & at the same time switch to non-legacy sysconf()

Without this, gcc warns about a sign mismatch in the comparison.

Signed-off-by: Cody P Schafer <dev@codyps.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cody P Schafer 10 years ago
parent
commit
426bd7e684
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ccan/talloc/talloc.c

+ 1 - 1
ccan/talloc/talloc.c

@@ -810,7 +810,7 @@ void *_talloc(const void *context, size_t size)
 
 static int talloc_destroy_pointer(void ***pptr)
 {
-	if ((uintptr_t)**pptr < getpagesize())
+	if ((uintptr_t)**pptr < (uintptr_t)sysconf(_SC_PAGESIZE))
 		TALLOC_ABORT("Double free or invalid talloc_set?");
 	/* Invalidate pointer so it can't be used again. */
 	**pptr = (void *)1;