summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2008-07-10 16:24:33 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2008-07-10 16:24:33 +0000
commita16000d8f2c04ad3c448033d27256d9b3fe53b34 (patch)
treef33491319689543ba4851547358a20a7b0e8cfdc
parentb6105db90e82d669aa77cf3583cd33ea0960a248 (diff)
downloadpcre-a16000d8f2c04ad3c448033d27256d9b3fe53b34.tar.gz
Previous change to pcretest wasn't correct for POSIX mode (needs zero
terminator). git-svn-id: svn://vcs.exim.org/pcre/code/trunk@363 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--pcretest.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/pcretest.c b/pcretest.c
index d611352..0263c54 100644
--- a/pcretest.c
+++ b/pcretest.c
@@ -2029,10 +2029,21 @@ while (!done)
len = q - dbuffer;
/* Move the data to the end of the buffer so that a read over the end of
- the buffer will be seen by valgrind, even if it doesn't cause a crash. */
+ the buffer will be seen by valgrind, even if it doesn't cause a crash. If
+ we are using the POSIX interface, we must include the terminating zero. */
- memmove(bptr + buffer_size - len, bptr, len);
- bptr += buffer_size - len;
+#if !defined NOPOSIX
+ if (posix || do_posix)
+ {
+ memmove(bptr + buffer_size - len - 1, bptr, len + 1);
+ bptr += buffer_size - len - 1;
+ }
+ else
+#endif
+ {
+ memmove(bptr + buffer_size - len, bptr, len);
+ bptr += buffer_size - len;
+ }
if ((all_use_dfa || use_dfa) && find_match_limit)
{