Welcome! Log In Create A New Profile


Re: Unexpected structure of macros in ngx_string.h

Maxim Dounin
January 12, 2021 07:58AM

On Tue, Jan 12, 2021 at 12:40:06AM +0000, Chris Newton wrote:

> I just came across a problem with an innocuous looking line of code in a
> new module I have been working on:
> if (tmp_str.len == 0)
> ngx_str_set(&tmp_str, "/");
> The modification of tmp_str.data to '/' was always being made, but the
> length wasn't if the test failed. This turns out to be caused by the style
> used in the definition of the ngx_str_set macro.

I always wonder why people intentionally ignore nginx style and
then complain something doesn't work for them. Following nginx
style and always using curly brackets is how it is expected to

Maxim Dounin
nginx-devel mailing list
Subject Author Views Posted

Unexpected structure of macros in ngx_string.h

Chris Newton 49 January 11, 2021 07:42PM

Re: Unexpected structure of macros in ngx_string.h

Maxim Dounin 17 January 12, 2021 07:58AM

Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 39
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready