From 238e43b9faa45c88fc2581e3d6d3a87187f3ec33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Sun, 3 Feb 2013 22:57:58 +0100
Subject: [PATCH] store: Write string length as a 32-bit integer.

* guix/store.scm (write-string): Write L as a 32-bit integer.  Bug
  introduced in 82c38fe64c84fc3febcc5c5aa7fe86454ccaf456 ("store:
  Micro-optimize `write-string'.")
---
 guix/store.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/store.scm b/guix/store.scm
index 560e5675ec7..4bb2270a59d 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -162,7 +162,7 @@ (define (write-string s p)
          (l (bytevector-length s))
          (m (modulo l 8))
          (b (make-bytevector (+ 8 l (if (zero? m) 0 (- 8 m))))))
-    (bytevector-u64-native-set! b 0 l)
+    (bytevector-u32-set! b 0 l (endianness little))
     (bytevector-copy! s 0 b 8 l)
     (put-bytevector p b)))
 
-- 
GitLab