bug-bash
[Top][All Lists]
Advanced

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

builtin printf's `%b` won't expand null


From: Tavis Ormandy
Subject: builtin printf's `%b` won't expand null
Date: Mon, 2 Aug 2004 10:09:09 +0100
User-agent: Mutt/1.5.6i

Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib
-march=pentium4 -O2 -pipe -w -fomit-frame-pointer
uname output: Linux insomniac 2.6.7 #1 Fri Jul 23 22:03:36 BST 2004 i686
Intel(R) Pentium(R) 4 CPU 1500MHz GenuineIntel GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 2.05b
Patch Level: 0
Release Status: release

Description:
        
        both of these work:

        $ printf "%c" $'\xff' | hexdump -e '"%#04x\n"'
        0xff
        $ printf "%b" \\xff | hexdump -e '"%#04x\n"'
        0xff
        
        but with 0x00, %c accepts it and %b won't
        $ printf "%c" $'\x00' | hexdump -e '"%#04x\n"'
        0000
        $ printf "%b" \\x00 | hexdump -e '"%#04x\n"'
        $

Repeat-By:
        printf "%b" \\x00 | hexdump -e '"%#04x\n"'

-- 
-------------------------------------
address@hidden | finger me for my gpg key.
-------------------------------------------------------




reply via email to

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