Fix size error, lack of safety check, and type warning.
- Fixed a problem where the length of a different string was being
used after concatenating a different one.
- Added in missing size checks to avoid buffer overruns.
- Corrected to size_t for proper tracking.
- Changed assumed remaining size to instead be compile-time safe.
Change-Id: I314effbdc14d725e5b16a5e655552c6a817cb3b2
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2221
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>