When using the Linux kernel UUID generator, null terminate
authorArt Cancro <ajc@uncensored.citadel.org>
Tue, 31 Jul 2012 21:36:53 +0000 (17:36 -0400)
committerArt Cancro <ajc@uncensored.citadel.org>
Tue, 31 Jul 2012 22:38:28 +0000 (18:38 -0400)
libcitadel/lib/tools.c

index d738451a14234f045e5eaee4fa4870397807152d..f520ee2d96b5365d2876a8385fbd50b6788672cb 100644 (file)
@@ -885,7 +885,10 @@ void generate_uuid(char *buf) {
                        int rv;
                        rv = fread(buf, 36, 1, fp);
                        fclose(fp);
-                       if (rv == 1) return;
+                       if (rv == 1) {
+                               buf[36] = 0;
+                               return;
+                       }
                }
        }