[Openvpn-devel] [XS] Change in openvpn[master]: buffer: Remove some useless casts on BLAST returns

"flichtenheld \(Code Review\) via Openvpn-devel" <[email protected]>
Newsgroups net.sourceforge.lists.openvpn-devel
Message-ID <[email protected]>
Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1845?usp=email

to review the following change.


Change subject: buffer: Remove some useless casts on BLAST returns
......................................................................

buffer: Remove some useless casts on BLAST returns

We can compare to '\0' without having to do casting.

Change-Id: I450568c0307a6372506d115cb389d172472140d4
Signed-off-by: Frank Lichtenheld <[email protected]>
---
M src/openvpn/buffer.c
1 file changed, 3 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/1845/1

diff --git a/src/openvpn/buffer.c b/src/openvpn/buffer.c
index bf38c68..87d3094 100644
--- a/src/openvpn/buffer.c
+++ b/src/openvpn/buffer.c
@@ -500,7 +500,7 @@
 void
 buf_null_terminate(struct buffer *buf)
 {
-    const char *last = (char *)BLAST(buf);
+    const uint8_t *last = BLAST(buf);
     if (last && *last == '\0') /* already terminated? */
     {
         return;
@@ -523,12 +523,12 @@
 {
     while (true)
     {
-        const char *last = (char *)BLAST(buf);
+        const uint8_t *last = BLAST(buf);
         if (!last)
         {
             break;
         }
-        if (char_class((unsigned char)*last, CC_CRLF | CC_NULL))
+        if (char_class(*last, CC_CRLF | CC_NULL))
         {
             if (!buf_inc_len(buf, -1))
             {

-- 
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1845?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I450568c0307a6372506d115cb389d172472140d4
Gerrit-Change-Number: 1845
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.