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

Re: [PATCH v3] http.postbuffer: allow full range of ssize_t values

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 31, 2017, 19:51 UTC
Message-ID
<xmqqfuhtxm01.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170331172631.12024-1-dturner@twosigma.com>
David Turner <dturner@twosigma.com> writes:
Show 24 quoted lines
> +static int git_parse_ssize_t(const char *value, ssize_t *ret)
> +{
> +	ssize_t tmp;
> +	if (!git_parse_signed(value, &tmp, maximum_signed_value_of_type(ssize_t)))
> +		return 0;
> +	*ret = tmp;
> +	return 1;
> +}
> +
>  NORETURN
>  static void die_bad_number(const char *name, const char *value)
>  {
> @@ -892,6 +901,14 @@ unsigned long git_config_ulong(const char *name, const char *value)
>  	return ret;
>  }
>  
> +ssize_t git_config_ssize_t(const char *name, const char *value)
> +{
> +	ssize_t ret;
> +	if (!git_parse_ssize_t(value, &ret))
> +		die_bad_number(name, value);
> +	return ret;
> +}
> +
Thanks.
Previous: David TurnerNext: Jeff King
Message 2 of 10 in “http.postbuffer: allow full range of ssize_t values”
  1. http.postbuffer: allow full range of ssize_t valuesDavid Turner, Mar 31, 2017
  2. Junio C HamanoMar 31, 2017
  3. Jeff KingApr 1, 2017
  4. Junio C HamanoApr 1, 2017
  5. David TurnerApr 3, 2017
  6. Jeff KingApr 4, 2017
  7. David TurnerApr 4, 2017
  8. Jeff KingApr 4, 2017
  9. Christian CouderApr 6, 2017
  10. Jeff KingApr 7, 2017

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.