Project

General

Profile

[Solved] buffer_is_equal_string(const buffer *a, const char *s, size_t b_len)

Added by laszlo.gyimothy 2 months ago

Hi All,

lighttpd git master version:

buffer_is_equal_string() method has 3 parameters, but it is used with only 2 parameters:

e.g.: mod_openssl.c

} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.cipher-list"))) {
   PATCH(ssl_cipher_list);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.dh-file"))) {
   PATCH(ssl_dh_file);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.ec-curve"))) {
   PATCH(ssl_ec_curve); 

I think it should be fixed. Am I right?

Laszlo


Replies (2)

RE: buffer_is_equal_string(const buffer *a, const char *s, size_t b_len) - Added by stbuehler 2 months ago

Hi Laszlo,

it wouldn't compile if the parameter count wouldn't match. The uppercase notation of CONST_STR_LEN indicates that CONST_STR_LEN is not a function but a macro - and it provides two parameters in the function call context (that is all the macro is about).

RE: buffer_is_equal_string(const buffer *a, const char *s, size_t b_len) - Added by laszlo.gyimothy 2 months ago

Thank you for the quick answer, that's true, I overlooked it. Now I can see the macro definition...

#define CONST_STR_LEN(x) x, (x) ? sizeof(x) - 1 : 0

:)

    (1-2/2)