Re: seperator error in __mask_snprintf_len

From: Andrew Morton
Date: Wed Jan 07 2004 - 14:37:34 EST


Joe Korty <joe.korty@xxxxxxxx> wrote:
>
> Against 2.6.1-rc1.
>
> --- base/lib/mask.c 2004-01-07 11:40:07.000000000 -0500
> +++ new/lib/mask.c 2004-01-07 11:51:26.000000000 -0500
> @@ -96,7 +96,7 @@
> while (i >= 1 && wordp[i] == 0)
> i--;
> while (i >= 0) {
> - len += snprintf(buf+len, buflen-len, "%s%x", sep, wordp[i]);
> + len += snprintf(buf+len, buflen-len, "%x%s", wordp[i], sep);
> sep = ",";
> i--;
> }

What does the patch do?

Just looking at this function, it seems to walking an array of longs using
a u32*. Could someone please convince me that this is correct on both
little-endian and big-endian 64-bit hardware?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/