Hi, Thank you for your patience! I will send a third version.
On Thu, Oct 9, 2014 at 5:27 PM, Eric Blake <ebl...@redhat.com> wrote: > On 10/09/2014 02:36 AM, Magnus Reftel wrote: >> + char* end; > Style: we prefer: > char *end; Done. >> + if (end==arg || *end!='\0' || seed > UINT_MAX) { > Style: spaces around operators: Done. > Bug: strtoul() sometimes reports error via errno; the only safe way to > use it is to first prime errno = 0, then do strtoul, then check if errno > was changed. > > Reimplementation: util/cutils.c already provides parse_uint() that takes > care of calling strtoul safely (hmm, that version only parses 64-bit > numbers; maybe we should expand it to also parse 32-bit numbers?) Solved both by switching to parse_uint. >> + {"seed", "QEMU_RAND_SEED", true, handle_arg_randseed, >> + "", "Seed for pseudo-random number generator"}, ... >> + if (getenv("QEMU_RAND_SEED")) { >> + handle_arg_randseed(getenv("QEMU_RAND_SEED")); >> + } > > Now that you have exactly one caller of the static function, it might > make sense to just inline the body of that function here. No, it may be called using the function pointer in the argument table, above. Best Regards Magnus reftel