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

Re: [PATCH] Prefer fgetc over fgets where possible

From
Taylor Blau <me@ttaylorr.com>
Date
Jul 17, 2023, 20:14 UTC
Message-ID
<ZLWhLH2xRq20jFFY@nand.local>
In-Reply-To
<pull.1550.git.git.1689608291732.gitgitgadget@gmail.com>
On Mon, Jul 17, 2023 at 03:38:11PM +0000, AtariDreams via GitGitGadget wrote:
Show 8 quoted lines
> ---
>     Prefer fgetc over fgets where possible
>
>     fputc is meant for single characters, fputs is for strings. We are
>     better off inserting sole \n characters as characters, not whole
>     strings.
>
>     Signed-off-by: Seija Kijin doremylover123@gmail.com

I tend to agree with Junio's assessment that adding churn here isn't strictly necessary / worth it, but if we do end up taking this patch, note that the subject should reference `fputc()` and `fputs()` instead of `fgetc()` and `fgets()`.

Taylor
Previous: Junio C HamanoNext: AreaZR via GitGitGadget
Message 3 of 4 in “Prefer fgetc over fgets where possible”
  1. Prefer fgetc over fgets where possibleAtariDreams via GitGitGadget, Jul 17, 2023
  2. Junio C HamanoJul 17, 2023
  3. Taylor BlauJul 17, 2023
  4. Prefer fgetc over fgets where possibleAreaZR via GitGitGadget, Dec 18, 2024

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.