diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-03-11 22:48:04 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-03-11 22:48:04 +0000 |
commit | e1ff0291a39991e4ce025ece424ca8fae82fd88b (patch) | |
tree | e6ee7cb6be3c393c67e43dbcab30199ddb26a34a /src | |
parent | 9f2d6b1be912f09e47c30b2ac7b79a9c5e7bdecc (diff) | |
download | gnunet-e1ff0291a39991e4ce025ece424ca8fae82fd88b.tar.gz gnunet-e1ff0291a39991e4ce025ece424ca8fae82fd88b.zip |
-LRN: use plibc SSCANF instead of sscanf
Diffstat (limited to 'src')
-rw-r--r-- | src/dv/test_transport_api_dv.c | 2 | ||||
-rw-r--r-- | src/fs/fs_uri.c | 2 | ||||
-rw-r--r-- | src/nat/gnunet-helper-nat-client.c | 2 | ||||
-rw-r--r-- | src/nat/nat.c | 2 | ||||
-rw-r--r-- | src/nat/nat_mini.c | 4 | ||||
-rw-r--r-- | src/testing/test_testing_group_remote.c | 2 | ||||
-rw-r--r-- | src/testing/test_testing_large_topology.c | 2 | ||||
-rw-r--r-- | src/testing/test_testing_topology.c | 2 | ||||
-rw-r--r-- | src/testing/test_testing_topology_blacklist.c | 2 | ||||
-rw-r--r-- | src/testing/testing_group.c | 18 | ||||
-rw-r--r-- | src/testing/testing_peergroup.c | 2 | ||||
-rw-r--r-- | src/transport/gnunet-transport-wlan-sender.c | 4 | ||||
-rw-r--r-- | src/util/configuration.c | 8 | ||||
-rw-r--r-- | src/util/os_installation.c | 2 | ||||
-rw-r--r-- | src/util/pseudonym.c | 2 | ||||
-rw-r--r-- | src/util/service.c | 10 | ||||
-rw-r--r-- | src/util/strings.c | 8 |
17 files changed, 37 insertions, 37 deletions
diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c index 386ea5f29..6165a9db2 100644 --- a/src/dv/test_transport_api_dv.c +++ b/src/dv/test_transport_api_dv.c | |||
@@ -1127,7 +1127,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
1127 | "connect_topology_option_modifier", | 1127 | "connect_topology_option_modifier", |
1128 | &connect_topology_option_modifier_string)) | 1128 | &connect_topology_option_modifier_string)) |
1129 | { | 1129 | { |
1130 | if (sscanf | 1130 | if (SSCANF |
1131 | (connect_topology_option_modifier_string, "%lf", | 1131 | (connect_topology_option_modifier_string, "%lf", |
1132 | &connect_topology_option_modifier) != 1) | 1132 | &connect_topology_option_modifier) != 1) |
1133 | { | 1133 | { |
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index 43cf2c5bd..db9b7d166 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c | |||
@@ -214,7 +214,7 @@ percent_decode_keyword (const char *in, char **emsg) | |||
214 | { | 214 | { |
215 | if (out[rpos] == '%') | 215 | if (out[rpos] == '%') |
216 | { | 216 | { |
217 | if (1 != sscanf (&out[rpos + 1], "%2X", &hx)) | 217 | if (1 != SSCANF (&out[rpos + 1], "%2X", &hx)) |
218 | { | 218 | { |
219 | GNUNET_free (out); | 219 | GNUNET_free (out); |
220 | *emsg = GNUNET_strdup (_("`%' must be followed by HEX number")); | 220 | *emsg = GNUNET_strdup (_("`%' must be followed by HEX number")); |
diff --git a/src/nat/gnunet-helper-nat-client.c b/src/nat/gnunet-helper-nat-client.c index 73504ab1d..cc51fb575 100644 --- a/src/nat/gnunet-helper-nat-client.c +++ b/src/nat/gnunet-helper-nat-client.c | |||
@@ -473,7 +473,7 @@ main (int argc, char *const *argv) | |||
473 | global_ret = 7; | 473 | global_ret = 7; |
474 | goto cleanup; | 474 | goto cleanup; |
475 | } | 475 | } |
476 | if ((1 != sscanf (argv[3], "%u", &p)) || (0 == p) || (0xFFFF < p)) | 476 | if ((1 != SSCANF (argv[3], "%u", &p)) || (0 == p) || (0xFFFF < p)) |
477 | { | 477 | { |
478 | fprintf (stderr, "Error parsing port value `%s'\n", argv[3]); | 478 | fprintf (stderr, "Error parsing port value `%s'\n", argv[3]); |
479 | global_ret = 8; | 479 | global_ret = 8; |
diff --git a/src/nat/nat.c b/src/nat/nat.c index 725bbe952..53301ebb1 100644 --- a/src/nat/nat.c +++ b/src/nat/nat.c | |||
@@ -795,7 +795,7 @@ nat_server_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
795 | #if HAVE_SOCKADDR_IN_SIN_LEN | 795 | #if HAVE_SOCKADDR_IN_SIN_LEN |
796 | sin_addr.sin_len = sizeof (sin_addr); | 796 | sin_addr.sin_len = sizeof (sin_addr); |
797 | #endif | 797 | #endif |
798 | if ((NULL == port_start) || (1 != sscanf (port_start, "%d", &port)) || | 798 | if ((NULL == port_start) || (1 != SSCANF (port_start, "%d", &port)) || |
799 | (-1 == inet_pton (AF_INET, mybuf, &sin_addr.sin_addr))) | 799 | (-1 == inet_pton (AF_INET, mybuf, &sin_addr.sin_addr))) |
800 | { | 800 | { |
801 | /* should we restart gnunet-helper-nat-server? */ | 801 | /* should we restart gnunet-helper-nat-server? */ |
diff --git a/src/nat/nat_mini.c b/src/nat/nat_mini.c index 830fdfd50..84cc84186 100644 --- a/src/nat/nat_mini.c +++ b/src/nat/nat_mini.c | |||
@@ -378,7 +378,7 @@ process_refresh_output (void *cls, const char *line) | |||
378 | if (NULL == strstr (s, pstr)) | 378 | if (NULL == strstr (s, pstr)) |
379 | return; /* skip */ | 379 | return; /* skip */ |
380 | if (1 != | 380 | if (1 != |
381 | sscanf (line, | 381 | SSCANF (line, |
382 | (mini->is_tcp) ? "%*u TCP %u->%*s:%*u %*s" : | 382 | (mini->is_tcp) ? "%*u TCP %u->%*s:%*u %*s" : |
383 | "%*u UDP %u->%*s:%*u %*s", &nport)) | 383 | "%*u UDP %u->%*s:%*u %*s", &nport)) |
384 | return; /* skip */ | 384 | return; /* skip */ |
@@ -446,7 +446,7 @@ process_map_output (void *cls, const char *line) | |||
446 | */ | 446 | */ |
447 | if ((NULL == (ipaddr = strstr (line, " "))) || | 447 | if ((NULL == (ipaddr = strstr (line, " "))) || |
448 | (NULL == (pstr = strstr (ipaddr, ":"))) || | 448 | (NULL == (pstr = strstr (ipaddr, ":"))) || |
449 | (1 != sscanf (pstr + 1, "%u", &port))) | 449 | (1 != SSCANF (pstr + 1, "%u", &port))) |
450 | { | 450 | { |
451 | return; /* skip line */ | 451 | return; /* skip line */ |
452 | } | 452 | } |
diff --git a/src/testing/test_testing_group_remote.c b/src/testing/test_testing_group_remote.c index e300f95e3..b06655ca4 100644 --- a/src/testing/test_testing_group_remote.c +++ b/src/testing/test_testing_group_remote.c | |||
@@ -171,7 +171,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
171 | data[count] = '\0'; | 171 | data[count] = '\0'; |
172 | temphost = GNUNET_malloc (sizeof (struct GNUNET_TESTING_Host)); | 172 | temphost = GNUNET_malloc (sizeof (struct GNUNET_TESTING_Host)); |
173 | ret = | 173 | ret = |
174 | sscanf (buf, "%a[a-zA-Z0-9]@%a[a-zA-Z0-9.]:%hd", | 174 | SSCANF (buf, "%a[a-zA-Z0-9]@%a[a-zA-Z0-9.]:%hd", |
175 | &temphost->username, &temphost->hostname, &temphost->port); | 175 | &temphost->username, &temphost->hostname, &temphost->port); |
176 | if (3 == ret) | 176 | if (3 == ret) |
177 | { | 177 | { |
diff --git a/src/testing/test_testing_large_topology.c b/src/testing/test_testing_large_topology.c index 605761105..ad6d973d2 100644 --- a/src/testing/test_testing_large_topology.c +++ b/src/testing/test_testing_large_topology.c | |||
@@ -1012,7 +1012,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
1012 | "connect_topology_option_modifier", | 1012 | "connect_topology_option_modifier", |
1013 | &connect_topology_option_modifier_string)) | 1013 | &connect_topology_option_modifier_string)) |
1014 | { | 1014 | { |
1015 | if (sscanf | 1015 | if (SSCANF |
1016 | (connect_topology_option_modifier_string, "%lf", | 1016 | (connect_topology_option_modifier_string, "%lf", |
1017 | &connect_topology_option_modifier) != 1) | 1017 | &connect_topology_option_modifier) != 1) |
1018 | { | 1018 | { |
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c index ba5e23791..112838f2f 100644 --- a/src/testing/test_testing_topology.c +++ b/src/testing/test_testing_topology.c | |||
@@ -1069,7 +1069,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
1069 | "connect_topology_option_modifier", | 1069 | "connect_topology_option_modifier", |
1070 | &connect_topology_option_modifier_string)) | 1070 | &connect_topology_option_modifier_string)) |
1071 | { | 1071 | { |
1072 | if (sscanf | 1072 | if (SSCANF |
1073 | (connect_topology_option_modifier_string, "%lf", | 1073 | (connect_topology_option_modifier_string, "%lf", |
1074 | &connect_topology_option_modifier) != 1) | 1074 | &connect_topology_option_modifier) != 1) |
1075 | { | 1075 | { |
diff --git a/src/testing/test_testing_topology_blacklist.c b/src/testing/test_testing_topology_blacklist.c index ad39f7d62..c90f48d9b 100644 --- a/src/testing/test_testing_topology_blacklist.c +++ b/src/testing/test_testing_topology_blacklist.c | |||
@@ -440,7 +440,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
440 | "connect_topology_option_modifier", | 440 | "connect_topology_option_modifier", |
441 | &connect_topology_option_modifier_string)) | 441 | &connect_topology_option_modifier_string)) |
442 | { | 442 | { |
443 | if (sscanf | 443 | if (SSCANF |
444 | (connect_topology_option_modifier_string, "%lf", | 444 | (connect_topology_option_modifier_string, "%lf", |
445 | &connect_topology_option_modifier) != 1) | 445 | &connect_topology_option_modifier) != 1) |
446 | { | 446 | { |
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index feb372c40..e8db98a91 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c | |||
@@ -1357,7 +1357,7 @@ update_config (void *cls, const char *section, const char *option, | |||
1357 | GNUNET_asprintf (&single_variable, "single_%s_per_host", section); | 1357 | GNUNET_asprintf (&single_variable, "single_%s_per_host", section); |
1358 | GNUNET_asprintf (&per_host_variable, "num_%s_per_host", section); | 1358 | GNUNET_asprintf (&per_host_variable, "num_%s_per_host", section); |
1359 | 1359 | ||
1360 | if ((0 == strcmp (option, "PORT")) && (1 == sscanf (value, "%u", &ival))) | 1360 | if ((0 == strcmp (option, "PORT")) && (1 == SSCANF (value, "%u", &ival))) |
1361 | { | 1361 | { |
1362 | if ((ival != 0) && | 1362 | if ((ival != 0) && |
1363 | (GNUNET_YES != | 1363 | (GNUNET_YES != |
@@ -1904,7 +1904,7 @@ create_small_world_ring (struct GNUNET_TESTING_PeerGroup *pg, | |||
1904 | GNUNET_CONFIGURATION_get_value_string (pg->cfg, "TESTING", "PERCENTAGE", | 1904 | GNUNET_CONFIGURATION_get_value_string (pg->cfg, "TESTING", "PERCENTAGE", |
1905 | &p_string)) | 1905 | &p_string)) |
1906 | { | 1906 | { |
1907 | if (sscanf (p_string, "%lf", &logNModifier) != 1) | 1907 | if (SSCANF (p_string, "%lf", &logNModifier) != 1) |
1908 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1908 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1909 | _ | 1909 | _ |
1910 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), | 1910 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), |
@@ -1916,7 +1916,7 @@ create_small_world_ring (struct GNUNET_TESTING_PeerGroup *pg, | |||
1916 | GNUNET_CONFIGURATION_get_value_string (pg->cfg, "TESTING", "PROBABILITY", | 1916 | GNUNET_CONFIGURATION_get_value_string (pg->cfg, "TESTING", "PROBABILITY", |
1917 | &p_string)) | 1917 | &p_string)) |
1918 | { | 1918 | { |
1919 | if (sscanf (p_string, "%lf", &probability) != 1) | 1919 | if (SSCANF (p_string, "%lf", &probability) != 1) |
1920 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1920 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1921 | _ | 1921 | _ |
1922 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), | 1922 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), |
@@ -2017,7 +2017,7 @@ create_nated_internet (struct GNUNET_TESTING_PeerGroup *pg, | |||
2017 | GNUNET_CONFIGURATION_get_value_string (pg->cfg, "TESTING", "PERCENTAGE", | 2017 | GNUNET_CONFIGURATION_get_value_string (pg->cfg, "TESTING", "PERCENTAGE", |
2018 | &p_string)) | 2018 | &p_string)) |
2019 | { | 2019 | { |
2020 | if (sscanf (p_string, "%lf", &nat_percentage) != 1) | 2020 | if (SSCANF (p_string, "%lf", &nat_percentage) != 1) |
2021 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 2021 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
2022 | _ | 2022 | _ |
2023 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), | 2023 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), |
@@ -2076,7 +2076,7 @@ create_nated_internet_copy (struct GNUNET_TESTING_PeerGroup *pg, | |||
2076 | GNUNET_CONFIGURATION_get_value_string (pg->cfg, "TESTING", "PERCENTAGE", | 2076 | GNUNET_CONFIGURATION_get_value_string (pg->cfg, "TESTING", "PERCENTAGE", |
2077 | &p_string)) | 2077 | &p_string)) |
2078 | { | 2078 | { |
2079 | if (sscanf (p_string, "%lf", &nat_percentage) != 1) | 2079 | if (SSCANF (p_string, "%lf", &nat_percentage) != 1) |
2080 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 2080 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
2081 | _ | 2081 | _ |
2082 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), | 2082 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), |
@@ -2165,7 +2165,7 @@ create_small_world (struct GNUNET_TESTING_PeerGroup *pg, | |||
2165 | GNUNET_CONFIGURATION_get_value_string (pg->cfg, "TESTING", "PERCENTAGE", | 2165 | GNUNET_CONFIGURATION_get_value_string (pg->cfg, "TESTING", "PERCENTAGE", |
2166 | &p_string)) | 2166 | &p_string)) |
2167 | { | 2167 | { |
2168 | if (sscanf (p_string, "%lf", &percentage) != 1) | 2168 | if (SSCANF (p_string, "%lf", &percentage) != 1) |
2169 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 2169 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
2170 | _ | 2170 | _ |
2171 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), | 2171 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), |
@@ -2185,7 +2185,7 @@ create_small_world (struct GNUNET_TESTING_PeerGroup *pg, | |||
2185 | GNUNET_CONFIGURATION_get_value_string (pg->cfg, "TESTING", "PROBABILITY", | 2185 | GNUNET_CONFIGURATION_get_value_string (pg->cfg, "TESTING", "PROBABILITY", |
2186 | &p_string)) | 2186 | &p_string)) |
2187 | { | 2187 | { |
2188 | if (sscanf (p_string, "%lf", &probability) != 1) | 2188 | if (SSCANF (p_string, "%lf", &probability) != 1) |
2189 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 2189 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
2190 | _ | 2190 | _ |
2191 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), | 2191 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), |
@@ -2322,7 +2322,7 @@ create_erdos_renyi (struct GNUNET_TESTING_PeerGroup *pg, | |||
2322 | GNUNET_CONFIGURATION_get_value_string (pg->cfg, "TESTING", "PROBABILITY", | 2322 | GNUNET_CONFIGURATION_get_value_string (pg->cfg, "TESTING", "PROBABILITY", |
2323 | &p_string)) | 2323 | &p_string)) |
2324 | { | 2324 | { |
2325 | if (sscanf (p_string, "%lf", &probability) != 1) | 2325 | if (SSCANF (p_string, "%lf", &probability) != 1) |
2326 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 2326 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
2327 | _ | 2327 | _ |
2328 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), | 2328 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), |
@@ -7031,7 +7031,7 @@ GNUNET_TESTING_hosts_load (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
7031 | data[count] = '\0'; | 7031 | data[count] = '\0'; |
7032 | temphost = GNUNET_malloc (sizeof (struct GNUNET_TESTING_Host)); | 7032 | temphost = GNUNET_malloc (sizeof (struct GNUNET_TESTING_Host)); |
7033 | ret = | 7033 | ret = |
7034 | sscanf (buf, "%a[a-zA-Z0-9_]@%a[a-zA-Z0-9.]:%hd", | 7034 | SSCANF (buf, "%a[a-zA-Z0-9_]@%a[a-zA-Z0-9.]:%hd", |
7035 | &temphost->username, &temphost->hostname, &temphost->port); | 7035 | &temphost->username, &temphost->hostname, &temphost->port); |
7036 | if (3 == ret) | 7036 | if (3 == ret) |
7037 | { | 7037 | { |
diff --git a/src/testing/testing_peergroup.c b/src/testing/testing_peergroup.c index 0119d6670..50f53dd1b 100644 --- a/src/testing/testing_peergroup.c +++ b/src/testing/testing_peergroup.c | |||
@@ -932,7 +932,7 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
932 | "connect_topology_option_modifier", | 932 | "connect_topology_option_modifier", |
933 | &temp_str)) | 933 | &temp_str)) |
934 | { | 934 | { |
935 | if (sscanf | 935 | if (SSCANF |
936 | (temp_str, "%lf", &pg_start_ctx->connect_topology_option_modifier) != 1) | 936 | (temp_str, "%lf", &pg_start_ctx->connect_topology_option_modifier) != 1) |
937 | { | 937 | { |
938 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 938 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
diff --git a/src/transport/gnunet-transport-wlan-sender.c b/src/transport/gnunet-transport-wlan-sender.c index 9f06b63b4..651b4d413 100644 --- a/src/transport/gnunet-transport-wlan-sender.c +++ b/src/transport/gnunet-transport-wlan-sender.c | |||
@@ -136,7 +136,7 @@ main (int argc, char *argv[]) | |||
136 | return 1; | 136 | return 1; |
137 | } | 137 | } |
138 | if (6 != | 138 | if (6 != |
139 | sscanf (argv[3], "%x-%x-%x-%x-%x-%x", &temp[0], &temp[1], &temp[2], | 139 | SSCANF (argv[3], "%x-%x-%x-%x-%x-%x", &temp[0], &temp[1], &temp[2], |
140 | &temp[3], &temp[4], &temp[5])) | 140 | &temp[3], &temp[4], &temp[5])) |
141 | { | 141 | { |
142 | fprintf (stderr, | 142 | fprintf (stderr, |
@@ -145,7 +145,7 @@ main (int argc, char *argv[]) | |||
145 | return 1; | 145 | return 1; |
146 | } | 146 | } |
147 | if (6 != | 147 | if (6 != |
148 | sscanf (argv[2], "%x-%x-%x-%x-%x-%x", &temp[0], &temp[1], &temp[2], | 148 | SSCANF (argv[2], "%x-%x-%x-%x-%x-%x", &temp[0], &temp[1], &temp[2], |
149 | &temp[3], &temp[4], &temp[5])) | 149 | &temp[3], &temp[4], &temp[5])) |
150 | { | 150 | { |
151 | fprintf (stderr, | 151 | fprintf (stderr, |
diff --git a/src/util/configuration.c b/src/util/configuration.c index 6ec9a7183..d006ed3ef 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c | |||
@@ -197,19 +197,19 @@ GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
197 | for (i = strlen (line) - 1; (i >= 0) && (isspace ((unsigned char) line[i])); | 197 | for (i = strlen (line) - 1; (i >= 0) && (isspace ((unsigned char) line[i])); |
198 | i--) | 198 | i--) |
199 | line[i] = '\0'; | 199 | line[i] = '\0'; |
200 | if (1 == sscanf (line, "@INLINE@ %191[^\n]", value)) | 200 | if (1 == SSCANF (line, "@INLINE@ %191[^\n]", value)) |
201 | { | 201 | { |
202 | /* @INLINE@ value */ | 202 | /* @INLINE@ value */ |
203 | if (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, value)) | 203 | if (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, value)) |
204 | ret = GNUNET_SYSERR; /* failed to parse included config */ | 204 | ret = GNUNET_SYSERR; /* failed to parse included config */ |
205 | } | 205 | } |
206 | else if (1 == sscanf (line, "[%99[^]]]", value)) | 206 | else if (1 == SSCANF (line, "[%99[^]]]", value)) |
207 | { | 207 | { |
208 | /* [value] */ | 208 | /* [value] */ |
209 | GNUNET_free (section); | 209 | GNUNET_free (section); |
210 | section = GNUNET_strdup (value); | 210 | section = GNUNET_strdup (value); |
211 | } | 211 | } |
212 | else if (2 == sscanf (line, " %63[^= ] = %191[^\n]", tag, value)) | 212 | else if (2 == SSCANF (line, " %63[^= ] = %191[^\n]", tag, value)) |
213 | { | 213 | { |
214 | /* tag = value */ | 214 | /* tag = value */ |
215 | /* Strip LF */ | 215 | /* Strip LF */ |
@@ -233,7 +233,7 @@ GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
233 | } | 233 | } |
234 | GNUNET_CONFIGURATION_set_value_string (cfg, section, tag, &value[i]); | 234 | GNUNET_CONFIGURATION_set_value_string (cfg, section, tag, &value[i]); |
235 | } | 235 | } |
236 | else if (1 == sscanf (line, " %63[^= ] =[^\n]", tag)) | 236 | else if (1 == SSCANF (line, " %63[^= ] =[^\n]", tag)) |
237 | { | 237 | { |
238 | /* tag = */ | 238 | /* tag = */ |
239 | GNUNET_CONFIGURATION_set_value_string (cfg, section, tag, ""); | 239 | GNUNET_CONFIGURATION_set_value_string (cfg, section, tag, ""); |
diff --git a/src/util/os_installation.c b/src/util/os_installation.c index b82813d74..e790ce10e 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c | |||
@@ -62,7 +62,7 @@ get_path_from_proc_maps () | |||
62 | while (NULL != fgets (line, sizeof (line), f)) | 62 | while (NULL != fgets (line, sizeof (line), f)) |
63 | { | 63 | { |
64 | if ((1 == | 64 | if ((1 == |
65 | sscanf (line, "%*x-%*x %*c%*c%*c%*c %*x %*2u:%*2u %*u%*[ ]%s", dir)) && | 65 | SSCANF (line, "%*x-%*x %*c%*c%*c%*c %*x %*2u:%*2u %*u%*[ ]%s", dir)) && |
66 | (NULL != (lgu = strstr (dir, "libgnunetutil")))) | 66 | (NULL != (lgu = strstr (dir, "libgnunetutil")))) |
67 | { | 67 | { |
68 | lgu[0] = '\0'; | 68 | lgu[0] = '\0'; |
diff --git a/src/util/pseudonym.c b/src/util/pseudonym.c index dd8ad08b3..2d0bf3fad 100644 --- a/src/util/pseudonym.c +++ b/src/util/pseudonym.c | |||
@@ -461,7 +461,7 @@ GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
461 | 461 | ||
462 | idx = -1; | 462 | idx = -1; |
463 | slen = strlen (ns_uname); | 463 | slen = strlen (ns_uname); |
464 | while ((slen > 0) && (1 != sscanf (&ns_uname[slen - 1], "-%u", &idx))) | 464 | while ((slen > 0) && (1 != SSCANF (&ns_uname[slen - 1], "-%u", &idx))) |
465 | slen--; | 465 | slen--; |
466 | if (slen == 0) | 466 | if (slen == 0) |
467 | return GNUNET_SYSERR; | 467 | return GNUNET_SYSERR; |
diff --git a/src/util/service.c b/src/util/service.c index 243e7daa9..7583dccb6 100644 --- a/src/util/service.c +++ b/src/util/service.c | |||
@@ -106,7 +106,7 @@ parse_ipv4_specification (const char *routeList) | |||
106 | while (i < count) | 106 | while (i < count) |
107 | { | 107 | { |
108 | cnt = | 108 | cnt = |
109 | sscanf (&routeList[pos], "%u.%u.%u.%u/%u.%u.%u.%u;", &temps[0], | 109 | SSCANF (&routeList[pos], "%u.%u.%u.%u/%u.%u.%u.%u;", &temps[0], |
110 | &temps[1], &temps[2], &temps[3], &temps[4], &temps[5], | 110 | &temps[1], &temps[2], &temps[3], &temps[4], &temps[5], |
111 | &temps[6], &temps[7]); | 111 | &temps[6], &temps[7]); |
112 | if (cnt == 8) | 112 | if (cnt == 8) |
@@ -133,7 +133,7 @@ parse_ipv4_specification (const char *routeList) | |||
133 | } | 133 | } |
134 | /* try second notation */ | 134 | /* try second notation */ |
135 | cnt = | 135 | cnt = |
136 | sscanf (&routeList[pos], "%u.%u.%u.%u/%u;", &temps[0], &temps[1], | 136 | SSCANF (&routeList[pos], "%u.%u.%u.%u/%u;", &temps[0], &temps[1], |
137 | &temps[2], &temps[3], &slash); | 137 | &temps[2], &temps[3], &slash); |
138 | if (cnt == 5) | 138 | if (cnt == 5) |
139 | { | 139 | { |
@@ -176,7 +176,7 @@ parse_ipv4_specification (const char *routeList) | |||
176 | /* try third notation */ | 176 | /* try third notation */ |
177 | slash = 32; | 177 | slash = 32; |
178 | cnt = | 178 | cnt = |
179 | sscanf (&routeList[pos], "%u.%u.%u.%u;", &temps[0], &temps[1], | 179 | SSCANF (&routeList[pos], "%u.%u.%u.%u;", &temps[0], &temps[1], |
180 | &temps[2], &temps[3]); | 180 | &temps[2], &temps[3]); |
181 | if (cnt == 4) | 181 | if (cnt == 4) |
182 | { | 182 | { |
@@ -1268,9 +1268,9 @@ setup_service (struct GNUNET_SERVICE_Context *sctx) | |||
1268 | #ifndef MINGW | 1268 | #ifndef MINGW |
1269 | errno = 0; | 1269 | errno = 0; |
1270 | if ((NULL != (lpid = getenv ("LISTEN_PID"))) && | 1270 | if ((NULL != (lpid = getenv ("LISTEN_PID"))) && |
1271 | (1 == sscanf (lpid, "%u", &pid)) && (getpid () == (pid_t) pid) && | 1271 | (1 == SSCANF (lpid, "%u", &pid)) && (getpid () == (pid_t) pid) && |
1272 | (NULL != (nfds = getenv ("LISTEN_FDS"))) && | 1272 | (NULL != (nfds = getenv ("LISTEN_FDS"))) && |
1273 | (1 == sscanf (nfds, "%u", &cnt)) && (cnt > 0) && (cnt < FD_SETSIZE) && | 1273 | (1 == SSCANF (nfds, "%u", &cnt)) && (cnt > 0) && (cnt < FD_SETSIZE) && |
1274 | (cnt + 4 < FD_SETSIZE)) | 1274 | (cnt + 4 < FD_SETSIZE)) |
1275 | { | 1275 | { |
1276 | sctx->lsocks = | 1276 | sctx->lsocks = |
diff --git a/src/util/strings.c b/src/util/strings.c index a6a5c7542..0d58ec567 100644 --- a/src/util/strings.c +++ b/src/util/strings.c | |||
@@ -235,7 +235,7 @@ GNUNET_STRINGS_fancy_size_to_bytes (const char *fancy_size, | |||
235 | { | 235 | { |
236 | ret += last; | 236 | ret += last; |
237 | last = 0; | 237 | last = 0; |
238 | if (1 != sscanf (tok, "%llu", &last)) | 238 | if (1 != SSCANF (tok, "%llu", &last)) |
239 | { | 239 | { |
240 | GNUNET_free (in); | 240 | GNUNET_free (in); |
241 | return GNUNET_SYSERR; /* expected number */ | 241 | return GNUNET_SYSERR; /* expected number */ |
@@ -314,7 +314,7 @@ GNUNET_STRINGS_fancy_time_to_relative (const char *fancy_size, | |||
314 | { | 314 | { |
315 | ret += last; | 315 | ret += last; |
316 | last = 0; | 316 | last = 0; |
317 | if (1 != sscanf (tok, "%llu", &last)) | 317 | if (1 != SSCANF (tok, "%llu", &last)) |
318 | { | 318 | { |
319 | GNUNET_free (in); | 319 | GNUNET_free (in); |
320 | return GNUNET_SYSERR; /* expected number */ | 320 | return GNUNET_SYSERR; /* expected number */ |
@@ -978,7 +978,7 @@ GNUNET_STRINGS_to_address_ipv6 (char *zt_addr, uint16_t addrlen, | |||
978 | port_colon = strrchr (zt_addr, ':'); | 978 | port_colon = strrchr (zt_addr, ':'); |
979 | if (port_colon == NULL) | 979 | if (port_colon == NULL) |
980 | return GNUNET_SYSERR; | 980 | return GNUNET_SYSERR; |
981 | ret = sscanf (port_colon, ":%u", &port); | 981 | ret = SSCANF (port_colon, ":%u", &port); |
982 | if (ret != 1 || port > 65535) | 982 | if (ret != 1 || port > 65535) |
983 | return GNUNET_SYSERR; | 983 | return GNUNET_SYSERR; |
984 | port_colon[0] = '\0'; | 984 | port_colon[0] = '\0'; |
@@ -1012,7 +1012,7 @@ GNUNET_STRINGS_to_address_ipv4 (char *zt_addr, uint16_t addrlen, | |||
1012 | if (addrlen < 9) | 1012 | if (addrlen < 9) |
1013 | return GNUNET_SYSERR; | 1013 | return GNUNET_SYSERR; |
1014 | 1014 | ||
1015 | cnt = sscanf (zt_addr, "%u.%u.%u.%u:%u", &temps[0], &temps[1], &temps[2], &temps[3], &port); | 1015 | cnt = SSCANF (zt_addr, "%u.%u.%u.%u:%u", &temps[0], &temps[1], &temps[2], &temps[3], &port); |
1016 | if (cnt != 5) | 1016 | if (cnt != 5) |
1017 | return GNUNET_SYSERR; | 1017 | return GNUNET_SYSERR; |
1018 | 1018 | ||