Junio C Hamano [off-list ref] wrote:
Pavel Roskin [off-list ref] writes:
[...]
quoted
quote_c_style_counted() in quote.c uses a dangerous construct, when a
variable is incremented once and used twice in the same expression.
Sorry, I do not follow you. Isn't && a sequence point?
quoted
- for (sp = name; (ch = *sp++) && (sp - name) <= namelen; ) {
-
+ for (sp = name; sp < name + namelen; sp++) {
Yes, it is, so it doesn't fix any bugs; but Pavel's version is definitely
more readable.
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria +56 32 654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513