diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-30 16:22:36 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-30 16:22:36 +0000 |
commit | 605b20e277c558eb284595aacbcd3c21168894d3 (patch) | |
tree | 11869f7d7a674459627eeeb5a30500ac45c10cf4 /networking | |
parent | 1eecaf26b0025e91183f18dc5fd686e8832f8ee2 (diff) | |
download | busybox-w32-605b20e277c558eb284595aacbcd3c21168894d3.tar.gz busybox-w32-605b20e277c558eb284595aacbcd3c21168894d3.tar.bz2 busybox-w32-605b20e277c558eb284595aacbcd3c21168894d3.zip |
replace printf with fputs where appropriate
Diffstat (limited to 'networking')
-rw-r--r-- | networking/libiproute/ipaddress.c | 14 | ||||
-rw-r--r-- | networking/libiproute/iprule.c | 7 |
2 files changed, 10 insertions, 11 deletions
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c index 6a5f2cfbd..86eaf7d86 100644 --- a/networking/libiproute/ipaddress.c +++ b/networking/libiproute/ipaddress.c | |||
@@ -167,20 +167,20 @@ static int print_linkinfo(struct sockaddr_nl ATTRIBUTE_UNUSED *who, | |||
167 | fprintf(fp, "%c link/%s ", _SL_, ll_type_n2a(ifi->ifi_type, b1, sizeof(b1))); | 167 | fprintf(fp, "%c link/%s ", _SL_, ll_type_n2a(ifi->ifi_type, b1, sizeof(b1))); |
168 | 168 | ||
169 | if (tb[IFLA_ADDRESS]) { | 169 | if (tb[IFLA_ADDRESS]) { |
170 | fprintf(fp, "%s", ll_addr_n2a(RTA_DATA(tb[IFLA_ADDRESS]), | 170 | fputs(ll_addr_n2a(RTA_DATA(tb[IFLA_ADDRESS]), |
171 | RTA_PAYLOAD(tb[IFLA_ADDRESS]), | 171 | RTA_PAYLOAD(tb[IFLA_ADDRESS]), |
172 | ifi->ifi_type, | 172 | ifi->ifi_type, |
173 | b1, sizeof(b1))); | 173 | b1, sizeof(b1)), fp); |
174 | } | 174 | } |
175 | if (tb[IFLA_BROADCAST]) { | 175 | if (tb[IFLA_BROADCAST]) { |
176 | if (ifi->ifi_flags&IFF_POINTOPOINT) | 176 | if (ifi->ifi_flags&IFF_POINTOPOINT) |
177 | fprintf(fp, " peer "); | 177 | fprintf(fp, " peer "); |
178 | else | 178 | else |
179 | fprintf(fp, " brd "); | 179 | fprintf(fp, " brd "); |
180 | fprintf(fp, "%s", ll_addr_n2a(RTA_DATA(tb[IFLA_BROADCAST]), | 180 | fputs(ll_addr_n2a(RTA_DATA(tb[IFLA_BROADCAST]), |
181 | RTA_PAYLOAD(tb[IFLA_BROADCAST]), | 181 | RTA_PAYLOAD(tb[IFLA_BROADCAST]), |
182 | ifi->ifi_type, | 182 | ifi->ifi_type, |
183 | b1, sizeof(b1))); | 183 | b1, sizeof(b1)), fp); |
184 | } | 184 | } |
185 | } | 185 | } |
186 | fputc('\n', fp); | 186 | fputc('\n', fp); |
@@ -282,10 +282,10 @@ static int print_addrinfo(struct sockaddr_nl ATTRIBUTE_UNUSED *who, | |||
282 | fprintf(fp, " family %d ", ifa->ifa_family); | 282 | fprintf(fp, " family %d ", ifa->ifa_family); |
283 | 283 | ||
284 | if (rta_tb[IFA_LOCAL]) { | 284 | if (rta_tb[IFA_LOCAL]) { |
285 | fprintf(fp, "%s", rt_addr_n2a(ifa->ifa_family, | 285 | fputs(rt_addr_n2a(ifa->ifa_family, |
286 | RTA_PAYLOAD(rta_tb[IFA_LOCAL]), | 286 | RTA_PAYLOAD(rta_tb[IFA_LOCAL]), |
287 | RTA_DATA(rta_tb[IFA_LOCAL]), | 287 | RTA_DATA(rta_tb[IFA_LOCAL]), |
288 | abuf, sizeof(abuf))); | 288 | abuf, sizeof(abuf)), fp); |
289 | 289 | ||
290 | if (rta_tb[IFA_ADDRESS] == NULL || | 290 | if (rta_tb[IFA_ADDRESS] == NULL || |
291 | memcmp(RTA_DATA(rta_tb[IFA_ADDRESS]), RTA_DATA(rta_tb[IFA_LOCAL]), 4) == 0) { | 291 | memcmp(RTA_DATA(rta_tb[IFA_ADDRESS]), RTA_DATA(rta_tb[IFA_LOCAL]), 4) == 0) { |
@@ -334,7 +334,7 @@ static int print_addrinfo(struct sockaddr_nl ATTRIBUTE_UNUSED *who, | |||
334 | if (ifa->ifa_flags) | 334 | if (ifa->ifa_flags) |
335 | fprintf(fp, "flags %02x ", ifa->ifa_flags); | 335 | fprintf(fp, "flags %02x ", ifa->ifa_flags); |
336 | if (rta_tb[IFA_LABEL]) | 336 | if (rta_tb[IFA_LABEL]) |
337 | fprintf(fp, "%s", (char*)RTA_DATA(rta_tb[IFA_LABEL])); | 337 | fputs((char*)RTA_DATA(rta_tb[IFA_LABEL]), fp); |
338 | if (rta_tb[IFA_CACHEINFO]) { | 338 | if (rta_tb[IFA_CACHEINFO]) { |
339 | struct ifa_cacheinfo *ci = RTA_DATA(rta_tb[IFA_CACHEINFO]); | 339 | struct ifa_cacheinfo *ci = RTA_DATA(rta_tb[IFA_CACHEINFO]); |
340 | char buf[128]; | 340 | char buf[128]; |
diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c index 18ae6b5ef..3c276e666 100644 --- a/networking/libiproute/iprule.c +++ b/networking/libiproute/iprule.c | |||
@@ -87,11 +87,10 @@ static int print_rule(struct sockaddr_nl *who ATTRIBUTE_UNUSED, | |||
87 | r->rtm_src_len | 87 | r->rtm_src_len |
88 | ); | 88 | ); |
89 | } else { | 89 | } else { |
90 | fprintf(fp, "%s", format_host(r->rtm_family, | 90 | fputs(format_host(r->rtm_family, |
91 | RTA_PAYLOAD(tb[RTA_SRC]), | 91 | RTA_PAYLOAD(tb[RTA_SRC]), |
92 | RTA_DATA(tb[RTA_SRC]), | 92 | RTA_DATA(tb[RTA_SRC]), |
93 | abuf, sizeof(abuf)) | 93 | abuf, sizeof(abuf)), fp); |
94 | ); | ||
95 | } | 94 | } |
96 | } else if (r->rtm_src_len) { | 95 | } else if (r->rtm_src_len) { |
97 | fprintf(fp, "0/%d", r->rtm_src_len); | 96 | fprintf(fp, "0/%d", r->rtm_src_len); |
@@ -154,7 +153,7 @@ static int print_rule(struct sockaddr_nl *who ATTRIBUTE_UNUSED, | |||
154 | } else | 153 | } else |
155 | fprintf(fp, "masquerade"); | 154 | fprintf(fp, "masquerade"); |
156 | } else if (r->rtm_type != RTN_UNICAST) | 155 | } else if (r->rtm_type != RTN_UNICAST) |
157 | fprintf(fp, "%s", rtnl_rtntype_n2a(r->rtm_type, b1, sizeof(b1))); | 156 | fputs(rtnl_rtntype_n2a(r->rtm_type, b1, sizeof(b1)), fp); |
158 | 157 | ||
159 | fputc('\n', fp); | 158 | fputc('\n', fp); |
160 | fflush(fp); | 159 | fflush(fp); |