Re: [PATCH 4/7] revert: Allow mixed pick and revert instructions
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Aug 14, 2011, 14:28 UTC
- Message-ID
- <20110814142846.GI18466@elie.gateway.2wire.net>
- In-Reply-To
- <CALkWK0=sggexB0HDN-6LsoLz2RO-ftABTnAYp7q-jVO0oCJu2A@mail.gmail.com>
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.