Re: [PATCH v2] Rewrite strbuf.c:strbuf_cmp() replace memcmp() with starts_with()
- From
- Alexandru Guduleasa <alexandru.guduleasa@gmail.com>
- Date
- Mar 22, 2014, 21:58 UTC
- Message-ID
- <CA+ph3SoiNtX+ghTZsWetgAJ23SYYsAzyq+RSwHhtaxQhq-Pk7g@mail.gmail.com>
- In-Reply-To
- <1395523516-10181-1-git-send-email-mustafaorkunacar@gmail.com>
Hi,
This does not seam correct to me. The memcmp function could have returned 3 relevant values (zero, positive and negative) and a non-zero result would have been returned by the if statement. With you modification, you replace a negative value from memcmp with a positive one.
Best regards, Alex Guduleasa