summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-02 09:29:48 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-02 09:29:48 +0000
commitdf1d1afe7c090f6337d254ec40f088e17d6a257b (patch)
treecbe4af1c031e6d9f36265f82b62a9f8551f6cd03 /handy.h
parent0cdfe552874fb0fdffd17424aa25a0c7a49d88e1 (diff)
downloadperl-df1d1afe7c090f6337d254ec40f088e17d6a257b.tar.gz
Oops. My maths was too generous (by 1).
p4raw-id: //depot/perl@24673
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/handy.h b/handy.h
index da4ea66c13..90cf26775a 100644
--- a/handy.h
+++ b/handy.h
@@ -605,7 +605,7 @@ hopefully catches attempts to access uninitialized memory.
(void)((n)>((MEM_SIZE)~0)/sizeof(t)?(Perl_croak_nocontext(a,b),0):0)
#define MEM_WRAP_CHECK_(n,t) MEM_WRAP_CHECK(n,t),
-#define PERL_STRLEN_ROUNDUP(n) ((void)(((n) > (MEM_SIZE)~0 - 2 * PERL_STRLEN_ROUNDUP_QUANTUM) ? (Perl_croak_nocontext(PL_memory_wrap),0):0),((n)&~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM-1))+PERL_STRLEN_ROUNDUP_QUANTUM)
+#define PERL_STRLEN_ROUNDUP(n) ((void)(((n) > (MEM_SIZE)~0 - 2 * PERL_STRLEN_ROUNDUP_QUANTUM) ? (Perl_croak_nocontext(PL_memory_wrap),0):0),((n-1)&~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM-1))+PERL_STRLEN_ROUNDUP_QUANTUM)
#else
@@ -614,7 +614,7 @@ hopefully catches attempts to access uninitialized memory.
#define MEM_WRAP_CHECK_2(n,t,a,b)
#define MEM_WRAP_CHECK_(n,t)
-#define PERL_STRLEN_ROUNDUP(n) (((n)&~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM-1))+PERL_STRLEN_ROUNDUP_QUANTUM)
+#define PERL_STRLEN_ROUNDUP(n) (((n-1)&~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM-1))+PERL_STRLEN_ROUNDUP_QUANTUM)
#endif