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

Re: sha1_to_hex() usage cleanup

From
Linus Torvalds <torvalds@osdl.org>
Date
May 4, 2006, 01:27 UTC
Message-ID
<Pine.LNX.4.64.0605031826070.4086@g5.osdl.org>
In-Reply-To
<7v1wvabp7a.fsf@assigned-by-dhcp.cox.net>
On Wed, 3 May 2006, Junio C Hamano wrote:
Show 5 quoted lines
> 
> Makes sort of sense in that the callers still need to be aware
> of the magic 4 limit but as long as they are they do not have to
> worry about allocation/deallocation/copying.  But is that kind
> of cheat maintainable?  I dunno.

If we just tell people that the rule is that it's still a statically allocated buffer, but that you can magically use two "sha1_to_hex()" calls in the same printf(), we'll probably get a good mix of "usable and safe".

		Linus
Previous: Junio C Hamano
Message 3 of 3 in “sha1_to_hex() usage cleanup”
  1. Linus TorvaldsMay 4, 2006
  2. Junio C HamanoMay 4, 2006
  3. Linus TorvaldsMay 4, 2006

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.