false bool is not NULL

There were a few places that used gboolean FALSE
in places where a pointer was expected to mean NULL.
gboolean FALSE being an int 0, this worked.

Both gcc and clang will error if compiled in C23 mode with
this (in C99 until C23, false is a macro constant that
expands to the integer constant 0; false has type int so
this is still legal; in C23 false has type bool and gcc
and clang warn about implicit conversions of bool to
pointers.)

Replace the calls with NULL.

Ping #19116
This commit is contained in:
John Thacker 2024-08-17 00:00:41 -04:00 committed by AndersBroman
parent 4b03ddd578
commit 7eadd0ea2a
6 changed files with 6 additions and 6 deletions

View File

@ -256,7 +256,7 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info,
/* User info tree */ /* User info tree */
user_info_item = proto_tree_add_string_format(rlogin_tree, hf_user_info, tvb, user_info_item = proto_tree_add_string_format(rlogin_tree, hf_user_info, tvb,
offset, info_len, false, offset, info_len, NULL,
"User info (%s)", "User info (%s)",
tvb_format_text(pinfo->pool, tvb, offset, info_len)); tvb_format_text(pinfo->pool, tvb, offset, info_len));
user_info_tree = proto_item_add_subtree(user_info_item, user_info_tree = proto_item_add_subtree(user_info_item,

View File

@ -2075,7 +2075,7 @@ looks_like_rpc_call(tvbuff_t *tvb, int offset)
* is better than nothing. * is better than nothing.
*/ */
if (rpc_prog_key == 0 || rpc_prog_key == 0xffffffff) if (rpc_prog_key == 0 || rpc_prog_key == 0xffffffff)
return false; return NULL;
version = tvb_get_ntohl(tvb, offset+16); version = tvb_get_ntohl(tvb, offset+16);
if (version > 10) if (version > 10)
return NULL; return NULL;

View File

@ -1249,7 +1249,7 @@ get_saphdb_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data
static int static int
dissect_saphdb_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) dissect_saphdb_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{ {
return dissect_saphdb_message(tvb, pinfo, tree, false); return dissect_saphdb_message(tvb, pinfo, tree, NULL);
} }
static int static int

View File

@ -115,7 +115,7 @@ static extcap_token_sentence *extcap_tokenize_sentence(const char *s) {
unsigned param_type = EXTCAP_PARAM_UNKNOWN; unsigned param_type = EXTCAP_PARAM_UNKNOWN;
if (!g_utf8_validate(s, -1, NULL)) if (!g_utf8_validate(s, -1, NULL))
return false; return NULL;
extcap_token_sentence *rs = g_new0(extcap_token_sentence, 1); extcap_token_sentence *rs = g_new0(extcap_token_sentence, 1);

View File

@ -2174,7 +2174,7 @@ wtap_dump_init_dumper(int file_type_subtype, wtap_compression_type compression_t
if (!wtap_dump_can_open(file_type_subtype)) { if (!wtap_dump_can_open(file_type_subtype)) {
/* Invalid type, or type we don't know how to write. */ /* Invalid type, or type we don't know how to write. */
*err = WTAP_ERR_UNWRITABLE_FILE_TYPE; *err = WTAP_ERR_UNWRITABLE_FILE_TYPE;
return false; return NULL;
} }
/* OK, we know how to write that file type/subtype; can we write /* OK, we know how to write that file type/subtype; can we write

View File

@ -133,7 +133,7 @@ create_tempdir(const char *parent_dir, const char *tmpl, GError **err)
g_free(temp_subdir); g_free(temp_subdir);
g_set_error_literal(err, G_FILE_ERROR, g_set_error_literal(err, G_FILE_ERROR,
g_file_error_from_errno(errno), g_strerror(errno)); g_file_error_from_errno(errno), g_strerror(errno));
return false; return NULL;
} }
return temp_subdir; return temp_subdir;