chiark / gitweb /
journal: include machine ID in QR code
authorLennart Poettering <lennart@poettering.net>
Mon, 20 Aug 2012 20:11:38 +0000 (22:11 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 20 Aug 2012 20:11:38 +0000 (22:11 +0200)
src/journal/journal-qrcode.c

index b4dab8e86a7d01ccc74b3513b7a328cf62371588..10a14e4deff10bfde14ad30003dff3b9e2a4e7b1 100644 (file)
@@ -46,7 +46,15 @@ static void print_border(FILE *output, unsigned width) {
         }
 }
 
-int print_qr_code(FILE *output, const void *seed, size_t seed_size, uint64_t start, uint64_t interval, const char *hn, sd_id128_t mahcine) {
+int print_qr_code(
+                FILE *output,
+                const void *seed,
+                size_t seed_size,
+                uint64_t start,
+                uint64_t interval,
+                const char *hn,
+                sd_id128_t machine) {
+
         FILE *f;
         char *url = NULL;
         size_t url_size = 0, i;
@@ -68,10 +76,13 @@ int print_qr_code(FILE *output, const void *seed, size_t seed_size, uint64_t sta
                 fprintf(f, "%02x", ((uint8_t*) seed)[i]);
         }
 
-        fprintf(f, "/%llx-%llx\n", (unsigned long long) start, (unsigned long long) interval);
+        fprintf(f, "/%llx-%llx?machine=" SD_ID128_FORMAT_STR,
+                (unsigned long long) start,
+                (unsigned long long) interval,
+                SD_ID128_FORMAT_VAL(machine));
 
         if (hn)
-                fprintf(f, "?hostname=%s", hn);
+                fprintf(f, ";hostname=%s", hn);
 
         if (ferror(f)) {
                 fclose(f);