Re: [PATCH 13/21] Collect skipping of header field names and calculation of line lengths in one place
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jun 10, 2007, 08:45 UTC
- Message-ID
- <Pine.LNX.4.64.0706100942510.4059@racer.site>
- In-Reply-To
- <200706090218.16281.johan@herland.net>
Hi,
On Sat, 9 Jun 2007, Johan Herland wrote:
Show 17 quoted lines
> + /*
> + * Advance header field pointers past their initial identifier.
> + * Calculate lengths of header fields.
> + */
> + type_line += strlen("type ");
> + type_len = tag_line - type_line - 1;
> + tag_line += strlen("tag ");
> + tag_len = tagger_line - tag_line - 1;
> +
> /* Get the actual type */
> - type_len = tag_line - type_line - strlen("type \n");
> if (type_len >= sizeof(type))
> return error("Tag object (@ char " PD_FMT "): "
> - "Type too long", type_line + 5 - data);
> - memcpy(type, type_line + 5, type_len);
> + "Type too long", type_line - data);
> + memcpy(type, type_line, type_len);This change does not clarify anything. It is exactly as confusing as before.
> - for (i = 4;;) {
> + for (i = 0;;) {I know you introduced this in another patch. This is an ugly construct. If you want people to review your patches, you might as well put in the effort to make the reviewing more pleasant.
Ciao, Dscho