From: Petr Uzel Date: Thu, 3 Feb 2011 14:04:59 +0000 (+0100) Subject: uuidd: correctly report number of generated subsequent UUIDs X-Git-Tag: v2.19~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0ee03a286734a1b10575801fef88903ba8bf17d4;p=thirdparty%2Futil-linux.git uuidd: correctly report number of generated subsequent UUIDs Before this change, "uuidd -t -n 1" reported "6fd0672e-2f9b-11e0-b9c8-000feae00cb0 and subsequent 1 UUIDs". That is two subsequent UUIDs, which is not correct. Signed-off-by: Petr Uzel --- diff --git a/misc-utils/uuidd.c b/misc-utils/uuidd.c index 97caa33001..145e6d0efb 100644 --- a/misc-utils/uuidd.c +++ b/misc-utils/uuidd.c @@ -369,7 +369,7 @@ static void server_loop(const char *socket_path, const char *pidfile_path, if (debug) { uuid_unparse(uu, str); printf(_("Generated time UUID %s and %d " - "following\n"), str, num); + "following\n"), str, num - 1); } memcpy(reply_buf, uu, sizeof(uu)); reply_len = sizeof(uu); @@ -505,7 +505,7 @@ int main(int argc, char **argv) uuid_unparse((unsigned char *) buf, str); - printf(_("%s and subsequent %d UUIDs\n"), str, num); + printf(_("%s and subsequent %d UUIDs\n"), str, num - 1); } else { printf(_("List of UUIDs:\n")); cp = buf + 4;