Re: Suspicious strcmp() in src/backend/parser/parse_expr.c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Suspicious strcmp() in src/backend/parser/parse_expr.c
Дата
Msg-id 1040.1554936212@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Suspicious strcmp() in src/backend/parser/parse_expr.c  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Ответы Re: Suspicious strcmp() in src/backend/parser/parse_expr.c  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-bugs
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> "Rikard" == Rikard Falkeborn <rikard.falkeborn@gmail.com> writes:
>  Rikard>     if (strcmp(*nodename, "+") == 0 ||
>  Rikard>             strcmp(*nodename, "-")) // <-- notice the lack of comparisson here
>  Rikard> Should the second part of the || be strcmp(*nodename, "-") == 0?

> Yes it should.

Indeed.  Considering how much I hate using strcmp's result as a boolean,
you'd think I'd have got that right.  Thanks for noticing!

            regards, tom lane



В списке pgsql-bugs по дате отправления:

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: Suspicious strcmp() in src/backend/parser/parse_expr.c
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Suspicious strcmp() in src/backend/parser/parse_expr.c