Re: trim_common_tail bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Dec 15, 2007 at 09:49:06AM -0800, Junio C Hamano wrote:

> Shoot.  Thanks for spotting.
> 
> Wouldn't it be enough to do:
> 
>   	for (i = 0, recovered = 0; recovered < trimmed && i <= ctx; i++) {
> 		while (recovered < trimmed && ap[recovered++] != '\n')
> 	        	; /* nothing */
> 	}
> 
> then (warning: I haven't had my coffee yet)?

Yes, I think that is equivalent. My sleep-deprived brain keeps thinking
there must be a more clear way of writing this whole loop, but it
escapes me at the moment.

-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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux