Happy New Year. (It's not just embed.pl).
[p5sagit/p5-mst-13.2.git] / util.c
diff --git a/util.c b/util.c
index 4976c75..d253126 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1,7 +1,7 @@
 /*    util.c
  *
  *    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- *    2000, 2001, 2002, 2003, 2004, 2005, by Larry Wall and others
+ *    2000, 2001, 2002, 2003, 2004, 2005, 2006, by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -139,7 +139,6 @@ Perl_safesysrealloc(Malloc_t where,MEM_SIZE size)
     where = (Malloc_t)((char*)where-sTHX);
     size += sTHX;
     if (((struct perl_memory_debug_header *)where)->interpreter != aTHX) {
-       /* int *nowhere = NULL; *nowhere = 0; */
         Perl_croak_nocontext("panic: realloc from wrong pool");
     }
 #  ifdef PERL_POISON
@@ -190,7 +189,6 @@ Perl_safesysfree(Malloc_t where)
 #ifdef PERL_TRACK_MEMPOOL
         where = (Malloc_t)((char*)where-sTHX);
         if (((struct perl_memory_debug_header *)where)->interpreter != aTHX) {
-           /* int *nowhere = NULL; *nowhere = 0; */
             Perl_croak_nocontext("panic: free from wrong pool");
        }
 #  ifdef PERL_POISON
@@ -5220,9 +5218,9 @@ Perl_my_cxt_init(pTHX_ int *index, size_t size)
     }
     
     /* make sure the array is big enough */
-    if (PL_my_cxt_size < *index + 1) {
-       if (PL_my_cxt_list) {
-           while (PL_my_cxt_size < *index + 1)
+    if (PL_my_cxt_size <= *index) {
+       if (PL_my_cxt_size) {
+           while (PL_my_cxt_size <= *index)
                PL_my_cxt_size *= 2;
            Renew(PL_my_cxt_list, PL_my_cxt_size, void *);
        }