GNU bug report logs - #35593
[PATCH] uuid: Pad resulting FAT uuid string with leading zeroes.

Previous Next

Package: guix-patches;

Reported by: Danny Milosavljevic <dannym <at> scratchpost.org>

Date: Sun, 5 May 2019 21:45:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: guix-patches <at> gnu.org
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>
Subject: [PATCH] uuid: Pad resulting FAT uuid string with leading zeroes.
Date: Sun,  5 May 2019 23:43:54 +0200
Fixes <https://bugs.gnu.org/35582>.
Reported by sirgazil <sirgazil <at> zoho.com>.

* gnu/system/uuid.scm (fat-uuid->string): Pad resulting string with leading
zeroes.
---
 gnu/system/uuid.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/system/uuid.scm b/gnu/system/uuid.scm
index f13960c3e9..7204d163d0 100644
--- a/gnu/system/uuid.scm
+++ b/gnu/system/uuid.scm
@@ -175,7 +175,7 @@ ISO9660 UUID representation."
   "Convert FAT32/FAT16 UUID, a 4-byte bytevector, to its string representation."
   (let ((high  (bytevector-uint-ref uuid 0 %fat-endianness 2))
         (low (bytevector-uint-ref uuid 2 %fat-endianness 2)))
-    (format #f "~:@(~x-~x~)" low high)))
+    (format #f "~:@(~4,'0x-~4,'0x~)" low high)))
 
 (define %fat-uuid-rx
   (make-regexp "^([[:xdigit:]]{4})-([[:xdigit:]]{4})$"))




This bug report was last modified 6 years and 16 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.