[OpenWrt-Devel] [PATCH 1/3] [rpcd] file: add md5sum support

John Crispin blogic at openwrt.org
Sun Mar 15 17:21:27 EDT 2015


Hi,

On 15/03/2015 22:00, Luka Perkov wrote:
> wbuf = blobmsg_alloc_string_buffer(&buf, "md5", 33);
> +
> +	for (i = 0; i < 16; i++)
> +		sprintf((wbuf + (i * 2)), "%02x", (uint8_t) md5[i]);

there is a set of brackets too many here

> +
> +	*(wbuf + 33) = 0;

is this not off by 1 ? if we want to be pedantic it should also be '\0'

i think wbuf[32] = '\0'; is a saner syntax

	John
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list