[Top][All Lists]

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

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

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

On Mon, Aug 02, 2004 at 11:11:43AM +0100, Stephane Chazelas wrote:
> This is seen by printf the same way as:
> printf %c ''
> You can't put a NUL character in a command argument, as command
> arguments (as well as environment variables) are NUL terminated
> strings.

Sure, I was just using it as an example.

> In that case, I agree  that it could be seen as a bug or a
> limitation as printf is given the "\x00" 4 chars string argument
> which is valid.
> All of zsh, ksh builtin printf and GNU or Solaris /bin/printf
> output the NUL here.

Maybe it looks more like a bug with this example:

$ printf "%b" \\xF0\\x00\\xBA
$ printf "%b" \\x00\\xF0\\xBA 

Thanks for the tip about GNU printf, as a temporary workaround I can
just enable -n printf :)

address@hidden | finger me for my gpg key.

reply via email to

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