From: Jonathan Nieder Date: Sun, 14 Aug 2011 14:28:46 GMT Subject: Re: [PATCH 4/7] revert: Allow mixed pick and revert instructions Message-ID: <20110814142846.GI18466@elie.gateway.2wire.net> In-Reply-To: Ramkumar Ramachandra wrote: > int len = strchrnul(p, '\n') - p; > if (len > 255 || len - strchrnul(p, '\n') + p != 0) > len = 255; Yuck. Why not just use a size_t? > Shouldn't it be part of error() atleast in the long term? The default implementation of error() is (practically speaking) a thin wrapper around fprintf. What are the new semantics you are proposing --- truncating %s arguments to one short line? I don't think that would be a good idea, since for example, some current callers might be passing "\n" explicitly as a %s argument.