/[pcre]/code/branches/pcre16/pcre_compile.c
ViewVC logotype

Diff of /code/branches/pcre16/pcre_compile.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 817 by zherczeg, Wed Dec 21 23:08:51 2011 UTC revision 818 by ph10, Thu Dec 22 20:11:31 2011 UTC
# Line 685  if (cd->workspace_size >= COMPILE_WORK_S Line 685  if (cd->workspace_size >= COMPILE_WORK_S
685      newsize - cd->workspace_size < WORK_SIZE_SAFETY_MARGIN)      newsize - cd->workspace_size < WORK_SIZE_SAFETY_MARGIN)
686   return ERR72;   return ERR72;
687    
688  newspace = (PUBL(malloc))(newsize);  newspace = (PUBL(malloc))(newsize * sizeof(pcre_uchar));
689  if (newspace == NULL) return ERR21;  if (newspace == NULL) return ERR21;
690    memcpy(newspace, cd->start_workspace, cd->workspace_size * sizeof(pcre_uchar));
 memcpy(newspace, cd->start_workspace, cd->workspace_size);  
691  cd->hwm = (pcre_uchar *)newspace + (cd->hwm - cd->start_workspace);  cd->hwm = (pcre_uchar *)newspace + (cd->hwm - cd->start_workspace);
692  if (cd->workspace_size > COMPILE_WORK_SIZE)  if (cd->workspace_size > COMPILE_WORK_SIZE)
693    (PUBL(free))((void *)cd->start_workspace);    (PUBL(free))((void *)cd->start_workspace);

Legend:
Removed from v.817  
changed lines
  Added in v.818

  ViewVC Help
Powered by ViewVC 1.1.5