guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: uuid: Fix NTFS UUID stringification.


From: guix-commits
Subject: branch master updated: uuid: Fix NTFS UUID stringification.
Date: Wed, 21 Jun 2023 10:39:51 -0400

This is an automated email from the git hooks/post-receive script.

nckx pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 65ed7a61f1 uuid: Fix NTFS UUID stringification.
65ed7a61f1 is described below

commit 65ed7a61f1ad01da440f0e7e08bfc32b43deed73
Author: Tobias Geerinckx-Rice <me@tobias.gr>
AuthorDate: Sun Jun 18 02:00:00 2023 +0200

    uuid: Fix NTFS UUID stringification.
    
    Previously, (ntfs-uuid->string (string->ntfs-uuid"5234ED0D34ECF53F"))
    would yield "5234EDD34ECF53F".
    
    Reported by sughosha in #guix.
    
    * gnu/system/uuid.scm (ntfs-uuid->string): Pad hex bytes with zero when
    needed.
---
 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 a95dc1b7d1..8f967387ad 100644
--- a/gnu/system/uuid.scm
+++ b/gnu/system/uuid.scm
@@ -209,7 +209,7 @@ ISO9660 UUID representation."
 
 (define (ntfs-uuid->string uuid)
   "Convert NTFS UUID, a 8-byte bytevector, to its string representation."
-  (format #f "~{~:@(~x~)~}" (reverse (bytevector->u8-list uuid))))
+  (format #f "~{~:@(~2,'0x~)~}" (reverse (bytevector->u8-list uuid))))
 
 (define %ntfs-uuid-rx
   (make-regexp "^([[:xdigit:]]{16})$"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]