Fix epicsStrnEscapedFromRaw() and epicsStrnRawFromEscaped()

Major rewrites; the original epicsStrnRawFromEscaped() could read
beyond the end of the input buffer if the input count ended in the
middle of an octal or hex escape sequence. Zero termination did not
always match the return count, and hex escapes were always 2 digits,
contrary to the C standard.

New versions don't use epicsSnprintf() or sscanf() for hex and octal
conversions, so should be slightly faster.

Added 81 new tests to check the above issues.
This commit is contained in:
Andrew Johnson
2014-12-01 11:34:58 -06:00
parent 1a94ea1045
commit 30b789aa49
3 changed files with 316 additions and 136 deletions
+5
View File
@@ -14,6 +14,11 @@
<h2 align="center">Changes between 3.15.0.2 and 3.15.1</h2>
<!-- Insert new items immediately below here ... -->
<h3>epicsStrnEscapedFromRaw() and epicsStrnRawFromEscaped()</h3>
<p>These routines have been rewritten; the previous implementations did not
always behave exactly as specified.</p>
<h3>Shared Library Versions</h3>
<p>On architectures that can support it, the shared library version number for