aboutsummaryrefslogtreecommitdiff
path: root/src/nat
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-03-11 22:48:04 +0000
committerChristian Grothoff <christian@grothoff.org>2012-03-11 22:48:04 +0000
commite1ff0291a39991e4ce025ece424ca8fae82fd88b (patch)
treee6ee7cb6be3c393c67e43dbcab30199ddb26a34a /src/nat
parent9f2d6b1be912f09e47c30b2ac7b79a9c5e7bdecc (diff)
downloadgnunet-e1ff0291a39991e4ce025ece424ca8fae82fd88b.tar.gz
gnunet-e1ff0291a39991e4ce025ece424ca8fae82fd88b.zip
-LRN: use plibc SSCANF instead of sscanf
Diffstat (limited to 'src/nat')
-rw-r--r--src/nat/gnunet-helper-nat-client.c2
-rw-r--r--src/nat/nat.c2
-rw-r--r--src/nat/nat_mini.c4
3 files changed, 4 insertions, 4 deletions
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 }