summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-08-13 13:54:29 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-08-13 13:54:29 +0000
commit966c0728f5179d87cdbadf13d13550b8d4dd4865 (patch)
treea8e296856d5c333e3f8a2193ef244475d83d1fee
parentecf6e517b5f65397507697c28c29981507a052ab (diff)
downloadlibparserutils-966c0728f5179d87cdbadf13d13550b8d4dd4865.tar.gz
libparserutils-966c0728f5179d87cdbadf13d13550b8d4dd4865.tar.bz2
Only attempt to randomise the utf8 buffer when NDEBUG is not defined.
Note that, if lpu is built with NDEBUG defined, then the randomisation is a NOP. Therefore, to use the randomisation, you want to build debug versions of both lpu and whatever's using it. svn path=/trunk/libparserutils/; revision=5085
-rw-r--r--include/parserutils/input/inputstream.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/parserutils/input/inputstream.h b/include/parserutils/input/inputstream.h
index 26f3353..7e811b4 100644
--- a/include/parserutils/input/inputstream.h
+++ b/include/parserutils/input/inputstream.h
@@ -85,7 +85,9 @@ static inline uintptr_t parserutils_inputstream_peek(
if (stream == NULL)
return PARSERUTILS_INPUTSTREAM_OOD;
+#ifndef NDEBUG
parserutils_buffer_randomise(stream->utf8);
+#endif
#define IS_ASCII(x) (((x) & 0x80) == 0)