t5303: fix printf format string for portability
authorJunio C Hamano <gitster@pobox.com>
Sun, 9 Nov 2008 21:11:06 +0000 (13:11 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 9 Nov 2008 21:11:06 +0000 (13:11 -0800)
printf "\x01" is bad; write printf "\001" for portability.

Testing with dash is a good way to find this kind of POSIX.1 violation
breakages.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5303-pack-corruption-resilience.sh
index f471eadb9696d70f47c3f5a13365a9c93e0cffb5..d4e30fc43c68ed9b0fc175f2a88a07de6458f58e 100755 (executable)
@@ -234,7 +234,7 @@ test_expect_success \
     'corruption #1 in delta base reference of first delta (OBJ_OFS_DELTA)' \
     'create_new_pack --delta-base-offset &&
      git prune-packed &&
-     tr "\000" "\001" </dev/zero | do_corrupt_object $blob_2 2 &&
+     printf "\001" | do_corrupt_object $blob_2 2 &&
      git cat-file blob $blob_1 > /dev/null &&
      test_must_fail git cat-file blob $blob_2 > /dev/null &&
      test_must_fail git cat-file blob $blob_3 > /dev/null'