ngx_snprintf question

Mike Gagnon mikegagnon at
Tue Apr 10 14:12:07 UTC 2012

I am getting unexpected results from ngx_snprintf in the following statement:

        ngx_snprintf((u_char *) buf, sizeof(buf), "%s\n",

with peer->peer_config-> == "\0".

I expect ngx_snprintf to yield buf == "\n\0", but
instead it yields buf == "\n\bf\0" (I was not expecting
that '\bf' character to be inserted there.)

When I change ngx_snprintf to just snprintf, it works as expected.

Any thoughts?

Mike Gagnon

More information about the nginx-devel mailing list