Hi Michael,
On 12/01/2016 05:32 PM, Michael Davidsaver wrote:
> Unless someone objects, I'm going to add epicsStrNLen() to epicsString.h
> on the 3.14 branch [2] when I fix a seemingly broken nil test in
> camessage.c [1]. I don't know if this can actually cause a crash, but
> knowingly calling strlen() on a string which may be missing a nil seems
> a recipe for problems at some point.
No objection, but please spell it "epicsStrnLen()" to match several
other routine names already in epicsString.h
> I'd rather use strlen() directly, but don't have time to fully
> investigate portability right now. RTEMS 4.9 has it, windows has it [3]
> and the glibc needs POSIX-2008 compatibility [4].
There is no strnlen() routine provided by VxWorks, so we do have to
provide our own implementation there at least. It'll be easiest to add
it to src/libCom/misc/epicsString.c and just use that everywhere instead
of trying to switch to an OS-provided one at compile-time.
- Andrew
--
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon
- References:
- strnlen? Michael Davidsaver
- Navigate by Date:
- Prev:
strnlen? Michael Davidsaver
- Next:
CII Best Practices Badge Status Andrew Johnson
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
<2016>
2017
2018
2019
2020
2021
2022
2023
2024
2025
- Navigate by Thread:
- Prev:
strnlen? Michael Davidsaver
- Next:
CII Best Practices Badge Status Andrew Johnson
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
<2016>
2017
2018
2019
2020
2021
2022
2023
2024
2025
|