Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
context.c: optimize buidling xml function
try to use memcpy when we know the source length. memcpy will operate on word or double-word, unlike iio_strlcpy which operates on a byte basis. Mark these calls as Flawfinder ignore, since we check the dest buffer length to to the source length before we do a copy. Rather than itererate over the dest string to find the end (with strrchr), just keep track with math. We know the start, and we know the length (from the outputs of iio_snprintf & iio_strlcpy), so just add them. Signed-off-by: Robin Getz <[email protected]>
- Loading branch information