"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
"Todd C. Miller" <Todd.Miller@sudo.ws>
Subject:
Re: Only use string literals as format strings for dprintf()
To:
Christian Weisgerber <naddy@mips.inka.de>
Cc:
gameoftrees@openbsd.org
Date:
Thu, 10 Sep 2020 15:14:36 -0600

Download raw body.

Thread
On Thu, 10 Sep 2020 23:04:20 +0200, Christian Weisgerber wrote:

> Like this?

asprintf(3) returns int, not size_t.  I would also split up the
assignment for readability.  E.g.

	int initial_content_len;

	initial_content_len = asprintf(&initial_content,
	    "\n# %s to be imported to branch %s\n", path_dir, branch_name);
	if (initial_content_len == -1)
		return got_error_from_errno("asprintf");

 - todd