]> sigrok.org Git - libsigrok.git/commitdiff
log: rephrase default sr_logv() routine, strip CR and LF
authorGerhard Sittig <redacted>
Sun, 19 Mar 2023 14:52:53 +0000 (15:52 +0100)
committerGerhard Sittig <redacted>
Sun, 19 Mar 2023 21:40:07 +0000 (22:40 +0100)
Unobfuscate how the unconditional prefix and the conditional timestamp
will prefix the caller's message. Separate the result check for emission
of the prefix/timestamp from the check for successful construction of
the caller's message text. Release the dynamic buffer in the error path.
Use pointers and character variables in the copy loop for readability.

Strip LF as well as CR from the resulting log output text. The previous
implementation exclusively stripped LF. Escaping non-printables is not
attempted in this version.


No differences found