Revision: 748
http://www.exim.org/viewvc/pcre2?view=rev&revision=748
Author: ph10
Date: 2017-04-14 13:14:41 +0100 (Fri, 14 Apr 2017)
Log Message:
-----------
Correct an incorrect cast.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/src/pcre2_valid_utf.c
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2017-04-14 12:08:54 UTC (rev 747)
+++ code/trunk/ChangeLog 2017-04-14 12:14:41 UTC (rev 748)
@@ -135,7 +135,9 @@
25. Remove a duplication typo in pcre2_tables.c
+26. Correct an incorrect cast in pcre2_valid_utf.c
+
Version 10.23 14-February-2017
------------------------------
Modified: code/trunk/src/pcre2_valid_utf.c
===================================================================
--- code/trunk/src/pcre2_valid_utf.c 2017-04-14 12:08:54 UTC (rev 747)
+++ code/trunk/src/pcre2_valid_utf.c 2017-04-14 12:14:41 UTC (rev 748)
@@ -7,7 +7,7 @@
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -142,13 +142,13 @@
if (c < 0xc0) /* Isolated 10xx xxxx byte */
{
- *erroroffset = (int)(p - string);
+ *erroroffset = (PCRE2_SIZE)(p - string);
return PCRE2_ERROR_UTF8_ERR20;
}
if (c >= 0xfe) /* Invalid 0xfe or 0xff bytes */
{
- *erroroffset = (int)(p - string);
+ *erroroffset = (PCRE2_SIZE)(p - string);
return PCRE2_ERROR_UTF8_ERR21;
}
@@ -155,7 +155,7 @@
ab = PRIV(utf8_table4)[c & 0x3f]; /* Number of additional bytes (1-5) */
if (length < ab) /* Missing bytes */
{
- *erroroffset = (int)(p - string);
+ *erroroffset = (PCRE2_SIZE)(p - string);
switch(ab - length)
{
case 1: return PCRE2_ERROR_UTF8_ERR1;