Symbian compilation fixes.
[silc.git] / lib / silcutil / silcstack.c
index 9432b22d25c10c69693345f6072156fd1b8066f8..fabef8ec7dbddc953b8ba2ff45cec6f7f4aafeca 100644 (file)
@@ -267,7 +267,8 @@ void *silc_stack_realloc(SilcStack stack, SilcUInt32 old_size,
   /* Check that `ptr' is last allocation */
   sptr = (unsigned char *)stack->stack[si] +
     SILC_STACK_ALIGN(sizeof(**stack->stack), SILC_STACK_DEFAULT_ALIGN);
-  if (stack->stack[si]->bytes_left + old_size + (ptr - sptr) != bsize) {
+  if (stack->stack[si]->bytes_left + old_size +
+      ((unsigned char *)ptr - (unsigned char *)sptr) != bsize) {
     SILC_LOG_DEBUG(("Cannot reallocate"));
     SILC_STACK_STAT(stack, num_errors, 1);
     return NULL;