diff options
author | Tobias Geerinckx-Rice <me@tobias.gr> | 2023-06-18 02:00:00 +0200 |
---|---|---|
committer | Tobias Geerinckx-Rice <me@tobias.gr> | 2023-06-18 02:00:10 +0200 |
commit | 65ed7a61f1ad01da440f0e7e08bfc32b43deed73 (patch) | |
tree | b8128aff0aa98bf0dac91b443fdf060c4fff26f2 /gnu | |
parent | 2e0228e736bf08d376ffbce6b5c4f899babfee5e (diff) | |
download | guix-patches-65ed7a61f1ad01da440f0e7e08bfc32b43deed73.tar guix-patches-65ed7a61f1ad01da440f0e7e08bfc32b43deed73.tar.gz |
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.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/system/uuid.scm | 2 |
1 files changed, 1 insertions, 1 deletions
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})$")) |