On Tue, Jul 12, 2005 at 11:56:33AM +0200, Miloslav Trmac wrote:
Hello, stack_info () in stunnel-4.11 uses "%d" to print values of type size_t. The attached patch fixes this. Mirek
Content-Description: stunnel-4.11-printf.patch
--- stunnel-4.11/src/sthreads.c.printf 2005-07-12 11:43:42.000000000 +0200 +++ stunnel-4.11/src/sthreads.c 2005-07-12 11:46:33.000000000 +0200 @@ -337,10 +337,10 @@ s_log(LOG_NOTICE, "stack_info: size=%d, current=%d (%d%%), maximum=%d (%d%%)", STACK_SIZE,
(VERIFY_AREA-num)*sizeof(u32),
(VERIFY_AREA-num)*sizeof(u32)*100/STACK_SIZE,
(VERIFY_AREA-min_num)*sizeof(u32),
(VERIFY_AREA-min_num)*sizeof(u32)*100/STACK_SIZE);
(int)((VERIFY_AREA-num)*sizeof(u32)),
(int)((VERIFY_AREA-num)*sizeof(u32)*100/STACK_SIZE),
(int)((VERIFY_AREA-min_num)*sizeof(u32)),
}(int)((VERIFY_AREA-min_num)*sizeof(u32)*100/STACK_SIZE));
}
%zu should be used for size_t. If it is not available, I suggest the cast to be to "unsigned long long", not "int".