]> git.ozlabs.org Git - ppp.git/commit
chat: Clean up usage of clean() function
authorPaul Mackerras <paulus@ozlabs.org>
Mon, 19 Jul 2021 07:41:09 +0000 (17:41 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Mon, 19 Jul 2021 07:41:09 +0000 (17:41 +1000)
commit9c7ba0d42dee5e3f84ecb6e4fcdbefc6c1cd965c
tree90760d00a5d1795edbb9d306dd87b12a364ebf18
parent919b28b82f08d7552e2f0febb715ddce6f7208d4
chat: Clean up usage of clean() function

In a couple of places, we were calling clean(), which does environment
variable substitution among other things, but then using the original
string not the "cleaned" string when logging a message about what
we're doing.

Also, this removes a couple of checks that the "cleaned" string is not
longer than the original string, which date back to the first version
of the code checked into CVS.  Those checks were appropriate before
environment variable substitution was added in commit eaca954c2d4a
("add -E option to use environment variables, from Andreas Arens") and
dynamic reallocation of the result buffer was added in commit
86dd2eec100d ("clean(): Fix buffer overflow.") but are no longer
necessary.

These changes were prompted by github issue #294 and redhat bugzilla
https://bugzilla.redhat.com/show_bug.cgi?id=1650539

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
chat/chat.c