From 87a9a18726605754bed652c7628d845fd7059690 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Thu, 14 Mar 2024 15:44:50 -0700 Subject: Convert extcap to C99 types Ping #19116 --- extcap/androiddump.c | 6 +++--- extcap/ciscodump.c | 4 ++-- extcap/falcodump.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'extcap') diff --git a/extcap/androiddump.c b/extcap/androiddump.c index ae63f9593e..47dfea9ba2 100644 --- a/extcap/androiddump.c +++ b/extcap/androiddump.c @@ -2646,13 +2646,13 @@ int main(int argc, char *argv[]) { if (ws_optarg && !*ws_optarg) logcat_text = true; else - logcat_text = (g_ascii_strncasecmp(ws_optarg, "TRUE", 4) == 0); + logcat_text = (g_ascii_strncasecmp(ws_optarg, "true", 4) == 0); break; case OPT_CONFIG_LOGCAT_IGNORE_LOG_BUFFER: if (ws_optarg == NULL || (ws_optarg && !*ws_optarg)) logcat_ignore_log_buffer = true; else - logcat_ignore_log_buffer = (g_ascii_strncasecmp(ws_optarg, "TRUE", 4) == 0); + logcat_ignore_log_buffer = (g_ascii_strncasecmp(ws_optarg, "true", 4) == 0); break; case OPT_CONFIG_LOGCAT_CUSTOM_OPTIONS: if (ws_optarg == NULL || (ws_optarg && *ws_optarg == '\0')) { @@ -2680,7 +2680,7 @@ int main(int argc, char *argv[]) { } break; case OPT_CONFIG_BT_FORWARD_SOCKET: - bt_forward_socket = (g_ascii_strncasecmp(ws_optarg, "TRUE", 4) == 0); + bt_forward_socket = (g_ascii_strncasecmp(ws_optarg, "true", 4) == 0); break; case OPT_CONFIG_BT_LOCAL_IP: bt_local_ip = ws_optarg; diff --git a/extcap/ciscodump.c b/extcap/ciscodump.c index 2331a05a55..de943c56d8 100644 --- a/extcap/ciscodump.c +++ b/extcap/ciscodump.c @@ -182,7 +182,7 @@ static int read_output_bytes_any(ssh_channel channel, int bytes, char* outbuf) int total; int bytes_read; - total = (bytes > 0 ? bytes : G_MAXINT); + total = (bytes > 0 ? bytes : INT_MAX); bytes_read = 0; while(ssh_channel_read_timeout(channel, &chr, 1, 0, CISCODUMP_READ_TIMEOUT_MSEC) > 0 && bytes_read < total) { @@ -205,7 +205,7 @@ static int read_output_bytes(ssh_channel channel, int bytes, char* outbuf) int total; int bytes_read; - total = (bytes > 0 ? bytes : G_MAXINT); + total = (bytes > 0 ? bytes : INT_MAX); bytes_read = 0; while(ssh_channel_read_timeout(channel, &chr, 1, 0, CISCODUMP_READ_TIMEOUT_MSEC) > 0 && bytes_read < total) { diff --git a/extcap/falcodump.cpp b/extcap/falcodump.cpp index 8ae01f3179..27c402f651 100644 --- a/extcap/falcodump.cpp +++ b/extcap/falcodump.cpp @@ -114,7 +114,7 @@ struct plugin_configuration { json_dumper_finish(&dumper); std::string config_blob = dumper.output_string->str; ws_debug("configuration: %s", dumper.output_string->str); - g_string_free(dumper.output_string, TRUE); + g_string_free(dumper.output_string, true); return config_blob; } }; @@ -142,7 +142,7 @@ void print_cloudtrail_aws_profile_config(int arg_num, const char *display, const // Look in files as specified in https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html char *cred_path = g_strdup(g_getenv("AWS_SHARED_CREDENTIALS_FILE")); if (cred_path == NULL) { - cred_path = g_build_filename(g_get_home_dir(), ".aws", "credentials", (gchar *)NULL); + cred_path = g_build_filename(g_get_home_dir(), ".aws", "credentials", (char *)NULL); } aws_fp = ws_fopen(cred_path, "r"); @@ -162,7 +162,7 @@ void print_cloudtrail_aws_profile_config(int arg_num, const char *display, const char *conf_path = g_strdup(g_getenv("AWS_CONFIG_FILE")); if (conf_path == NULL) { - conf_path = g_build_filename(g_get_home_dir(), ".aws", "config", (gchar *)NULL); + conf_path = g_build_filename(g_get_home_dir(), ".aws", "config", (char *)NULL); } aws_fp = ws_fopen(conf_path, "r"); @@ -526,7 +526,7 @@ const std::pair get_schema_properties(const std::string default_value, }; property_list.push_back(properties); - g_free((gpointer)call); + g_free((void *)call); idx += prop_tokens; opt_idx++; } -- cgit v1.2.3