On Mon, Feb 01, 2010 at 09:21:51AM -0800, Junio C Hamano wrote: > Unless we document "this function is to C-quote a (portion of a) string, > either to the end or up to the given length", however, future callers may > incorrectly assume that with length the function can be fed anything and > would C-quote that piece of memory. The argument name "const char *name" > already suggests that is not an arbitrary binary rubbish, changing that to > "str" would probably make that a bit stronger documentation, or we could > explicitly say "this is a (early part of a) NUL-terminated string" in a > comment. > > But your one-liner patch would actually be a smaller change than any of > them and makes the whole problem disappear; wouldn't it be a far better > solution? Sure, if you are going to bother to document it to future-proof against new callers, you might as well just make it more flexible with my one-liner. I don't think it will impact the behavior of any existing callers either way. I was just going to not bother, but perhaps while we have spent some brain cycles on it, it is better to just fix it. Either way is fine with me. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html