svn commit: trunk/busybox: e2fsprogs/old_e2fsprogs networking/libip etc...

vda at busybox.net vda at busybox.net
Sun Sep 30 16:22:37 UTC 2007


Author: vda
Date: 2007-09-30 09:22:36 -0700 (Sun, 30 Sep 2007)
New Revision: 20145

Log:
replace printf with fputs where appropriate



Modified:
   trunk/busybox/e2fsprogs/old_e2fsprogs/e2fsck.c
   trunk/busybox/networking/libiproute/ipaddress.c
   trunk/busybox/networking/libiproute/iprule.c


Changeset:
Modified: trunk/busybox/e2fsprogs/old_e2fsprogs/e2fsck.c
===================================================================
--- trunk/busybox/e2fsprogs/old_e2fsprogs/e2fsck.c	2007-09-30 16:04:21 UTC (rev 20144)
+++ trunk/busybox/e2fsprogs/old_e2fsprogs/e2fsck.c	2007-09-30 16:22:36 UTC (rev 20145)
@@ -2654,7 +2654,7 @@
 		printf("%u", ctx->ino2);
 		break;
 	case 'm':
-		printf("%s", error_message(ctx->errcode));
+		fputs(error_message(ctx->errcode), stdout);
 		break;
 	case 'N':
 		printf("%"PRIi64, ctx->num);
@@ -2676,7 +2676,7 @@
 		printf("%d", get_backup_sb(NULL, fs, NULL, NULL));
 		break;
 	case 's':
-		printf("%s", ctx->str ? ctx->str : "NULL");
+		fputs((ctx->str ? ctx->str : "NULL"), stdout);
 		break;
 	case 'X':
 		printf("0x%"PRIi64, ctx->num);

Modified: trunk/busybox/networking/libiproute/ipaddress.c
===================================================================
--- trunk/busybox/networking/libiproute/ipaddress.c	2007-09-30 16:04:21 UTC (rev 20144)
+++ trunk/busybox/networking/libiproute/ipaddress.c	2007-09-30 16:22:36 UTC (rev 20145)
@@ -167,20 +167,20 @@
 		fprintf(fp, "%c    link/%s ", _SL_, ll_type_n2a(ifi->ifi_type, b1, sizeof(b1)));
 
 		if (tb[IFLA_ADDRESS]) {
-			fprintf(fp, "%s", ll_addr_n2a(RTA_DATA(tb[IFLA_ADDRESS]),
+			fputs(ll_addr_n2a(RTA_DATA(tb[IFLA_ADDRESS]),
 						      RTA_PAYLOAD(tb[IFLA_ADDRESS]),
 						      ifi->ifi_type,
-						      b1, sizeof(b1)));
+						      b1, sizeof(b1)), fp);
 		}
 		if (tb[IFLA_BROADCAST]) {
 			if (ifi->ifi_flags&IFF_POINTOPOINT)
 				fprintf(fp, " peer ");
 			else
 				fprintf(fp, " brd ");
-			fprintf(fp, "%s", ll_addr_n2a(RTA_DATA(tb[IFLA_BROADCAST]),
+			fputs(ll_addr_n2a(RTA_DATA(tb[IFLA_BROADCAST]),
 						      RTA_PAYLOAD(tb[IFLA_BROADCAST]),
 						      ifi->ifi_type,
-						      b1, sizeof(b1)));
+						      b1, sizeof(b1)), fp);
 		}
 	}
 	fputc('\n', fp);
@@ -282,10 +282,10 @@
 		fprintf(fp, "    family %d ", ifa->ifa_family);
 
 	if (rta_tb[IFA_LOCAL]) {
-		fprintf(fp, "%s", rt_addr_n2a(ifa->ifa_family,
+		fputs(rt_addr_n2a(ifa->ifa_family,
 					      RTA_PAYLOAD(rta_tb[IFA_LOCAL]),
 					      RTA_DATA(rta_tb[IFA_LOCAL]),
-					      abuf, sizeof(abuf)));
+					      abuf, sizeof(abuf)), fp);
 
 		if (rta_tb[IFA_ADDRESS] == NULL ||
 		    memcmp(RTA_DATA(rta_tb[IFA_ADDRESS]), RTA_DATA(rta_tb[IFA_LOCAL]), 4) == 0) {
@@ -334,7 +334,7 @@
 	if (ifa->ifa_flags)
 		fprintf(fp, "flags %02x ", ifa->ifa_flags);
 	if (rta_tb[IFA_LABEL])
-		fprintf(fp, "%s", (char*)RTA_DATA(rta_tb[IFA_LABEL]));
+		fputs((char*)RTA_DATA(rta_tb[IFA_LABEL]), fp);
 	if (rta_tb[IFA_CACHEINFO]) {
 		struct ifa_cacheinfo *ci = RTA_DATA(rta_tb[IFA_CACHEINFO]);
 		char buf[128];

Modified: trunk/busybox/networking/libiproute/iprule.c
===================================================================
--- trunk/busybox/networking/libiproute/iprule.c	2007-09-30 16:04:21 UTC (rev 20144)
+++ trunk/busybox/networking/libiproute/iprule.c	2007-09-30 16:22:36 UTC (rev 20145)
@@ -87,11 +87,10 @@
 				r->rtm_src_len
 				);
 		} else {
-			fprintf(fp, "%s", format_host(r->rtm_family,
+			fputs(format_host(r->rtm_family,
 						       RTA_PAYLOAD(tb[RTA_SRC]),
 						       RTA_DATA(tb[RTA_SRC]),
-						       abuf, sizeof(abuf))
-				);
+						       abuf, sizeof(abuf)), fp);
 		}
 	} else if (r->rtm_src_len) {
 		fprintf(fp, "0/%d", r->rtm_src_len);
@@ -154,7 +153,7 @@
 		} else
 			fprintf(fp, "masquerade");
 	} else if (r->rtm_type != RTN_UNICAST)
-		fprintf(fp, "%s", rtnl_rtntype_n2a(r->rtm_type, b1, sizeof(b1)));
+		fputs(rtnl_rtntype_n2a(r->rtm_type, b1, sizeof(b1)), fp);
 
 	fputc('\n', fp);
 	fflush(fp);




More information about the busybox-cvs mailing list