ossp-pkg/uuid/uuid.c 1.32 -> 1.33
--- uuid.c 2004/01/16 12:20:45 1.32
+++ uuid.c 2004/01/17 14:21:57 1.33
@@ -781,6 +781,7 @@
time_t t_sec;
char buf[19+1]; /* YYYY-MM-DD HH:MM:SS */
struct tm *tm;
+ int r;
/* sanity check argument(s) */
if (uuid == NULL || str == NULL)
@@ -794,6 +795,14 @@
uuid_format(uuid, &s);
str_rsprintf(str, "UUID: %s\n", s);
+ /* short-circuit special case of 'nil UUID' */
+ if (uuid_isnil(uuid, &r), r) {
+ str_rsprintf(str, "variant: [none]\n"
+ "version: [none]\n"
+ "content: Nil UUID\n");
+ return UUID_RC_OK;
+ }
+
/* decode UUID variant */
variant = "unknown";
tmp8 = uuid->obj.clock_seq_hi_and_reserved;
|
|