git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] Rewrite strbuf.c:strbuf_cmp() replace memcmp() with starts_with()

From
AGAlexandru 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

Previous: Mustafa Orkun AcarNext: David Kastrup
Message 2 of 4 in “Rewrite strbuf.c:strbuf_cmp() replace memcmp() with starts_with()”
  1. Rewrite strbuf.c:strbuf_cmp() replace memcmp() with starts_with()Mustafa Orkun Acar, Mar 22, 2014
  2. Alexandru GuduleasaMar 22, 2014
  3. David KastrupMar 22, 2014
  4. Eric SunshineMar 23, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.