diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2016-12-25 17:36:41 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2016-12-25 17:36:41 +0000 |
commit | 9df60b4c472359d6d1a92fd62dd74feb002f14fc (patch) | |
tree | 9ea46580cac4aa19cbb07881b98d52200f5b9c36 /editor/pnmpad.c | |
parent | ba0c660b33b95c870f275466af5e6342759e621a (diff) | |
download | netpbm-mirror-9df60b4c472359d6d1a92fd62dd74feb002f14fc.tar.gz netpbm-mirror-9df60b4c472359d6d1a92fd62dd74feb002f14fc.tar.xz netpbm-mirror-9df60b4c472359d6d1a92fd62dd74feb002f14fc.zip |
Copy Development as new Advanced
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2861 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor/pnmpad.c')
-rw-r--r-- | editor/pnmpad.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/pnmpad.c b/editor/pnmpad.c index 051f3895..9c7a77e5 100644 --- a/editor/pnmpad.c +++ b/editor/pnmpad.c @@ -2,6 +2,7 @@ ** AJCD 4/9/90 */ +#include <assert.h> #include <string.h> #include <stdio.h> @@ -315,8 +316,10 @@ computePadSizeBeforeMult(unsigned int const unpaddedSize, (unpaddedSize + endPadReq); } else { if (sizeReq > unpaddedSize) { + assert(align <= 1.0 && align >= 0.0); *begPadP = ROUNDU((sizeReq - unpaddedSize) * align); *endPadP = sizeReq - unpaddedSize - *begPadP; + assert(*begPadP + unpaddedSize + *endPadP == sizeReq); } else { *begPadP = 0; *endPadP = 0; |