Re: [PATCH] Add compat/vsnprintf.c for systems that returns -1 on maxsize reached

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

 



Wayne Davison <wayne@xxxxxxxxxxxxx> writes:

> I'd suggest using a longer buf, requesting a longer length (e.g. 3
> instead of 1), and then making sure that the resulting buf is right
> (e.g. "12" instead of "123").
>
> 		[[char buf[6];
> 		  if (test_vsnprintf(buf, 3, "%s", "12345") != 5
> 		   || strcmp(buf, "12") != 0) return 1;
> 		  if (snprintf(buf, 3, "%s", "12345") != 5
> 		   || strcmp(buf, "12") != 0) return 1]])],

That sounds like a sensible thing to do.

Other than that, the patch in

    Message-Id: <200803051646.13343.michal.rokos@xxxxxxxxxxx>

looked Ok to me.

--
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