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

[PATCH] unquote_c_style: fix off-by-one.

From
Pierre Habouzit <madcoder@debian.org>
Date
Mar 6, 2008, 21:28 UTC
Message-ID
<20080306212819.GA10873@artemis.madism.org>
Thanks to Adeodato Simò for having caught this.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
 quote.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/quote.c b/quote.c
index d061626..40702f6 100644
--- a/quote.c
+++ b/quote.c
@@ -288,7 +288,7 @@ int unquote_c_style(struct strbuf *sb, const char *quoted, const char **endp)
 		switch (*quoted++) {
 		  case '"':
 			if (endp)
-				*endp = quoted + 1;
+				*endp = quoted;
 			return 0;
 		  case '\\':
 			break;
-- 
1.5.4.3.593.g07854
Next: Junio C Hamano
Message 1 of 5 in “unquote_c_style: fix off-by-one.”
  1. unquote_c_style: fix off-by-one.Pierre Habouzit, Mar 6, 2008
  2. Junio C HamanoMar 6, 2008
  3. Pierre HabouzitMar 7, 2008
  4. Adeodato SimóMar 7, 2008
  5. Junio C HamanoMar 7, 2008

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.