From f7345f3999551c16ef7af0e6f52a2ede3c919f3d Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Thu, 13 May 2010 19:13:14 +0000 Subject: make logging of buffer checks consistent git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1104 ef36b2f9-881f-0410-afb5-c4e39611909c --- common/nslcd-prot.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/nslcd-prot.h b/common/nslcd-prot.h index abfb4cb..ade9c7d 100644 --- a/common/nslcd-prot.h +++ b/common/nslcd-prot.h @@ -180,7 +180,8 @@ static void debug_dump(const void *ptr,size_t size) if (((size_t)tmpint32)>=sizeof(buffer)) \ { \ /* will not fit */ \ - DEBUG_PRINT("READ : buffer error: %d bytes too large",(tmpint32-sizeof(buffer))+1); \ + tmpint32=(tmpint32-sizeof(buffer))+1; \ + DEBUG_PRINT("READ : buffer %d bytes too small",tmpint32); \ ERROR_OUT_BUFERROR(fp); \ } \ /* read string from the stream */ \ @@ -209,7 +210,8 @@ static void debug_dump(const void *ptr,size_t size) if ((bufptr+(size_t)(sz))>buflen) \ { \ /* will not fit */ \ - DEBUG_PRINT("READ : buffer error: %d bytes too small",(bufptr+(sz)-(buflen))); \ + tmpint32=bufptr+(sz)-(buflen); \ + DEBUG_PRINT("READ : buffer %d bytes too small",tmpint32); \ ERROR_OUT_BUFERROR(fp); \ } -- cgit v1.2.3