Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/libbb/dump.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/libbb/dump.c
r2725 r3232 72 72 * case it's a %s format. 73 73 */ 74 while (strchr(index_str + 1, *++fmt)); 74 while (strchr(index_str + 1, *++fmt)) 75 continue; 75 76 if (*fmt == '.' && isdigit(*++fmt)) { 76 77 prec = atoi(fmt); … … 100 101 { 101 102 enum { NOTOKAY, USEBCNT, USEPREC } sokay; 102 PR *pr, **nextpr = NULL;103 103 FU *fu; 104 PR *pr; 104 105 char *p1, *p2, *p3; 105 106 char savech, *fmtp; … … 112 113 * conversion character gets its own. 113 114 */ 114 for (nconv = 0, fmtp = fu->fmt; *fmtp; nextpr = &pr->nextpr) {115 for (nconv = 0, fmtp = fu->fmt; *fmtp; ) { 115 116 /* NOSTRICT */ 116 117 /* DBU:[dvae@cray.com] zalloc so that forward ptrs start out NULL*/ … … 118 119 if (!fu->nextpr) 119 120 fu->nextpr = pr; 120 /* ignore nextpr -- its unused inside the loop and is121 * uninitialized 1st time through.122 */123 121 124 122 /* skip preceding text and up to the next % sign */ … … 296 294 * repeat it as necessary. 297 295 * 298 * if ,rep count is greater than 1, no trailing whitespace296 * if rep count is greater than 1, no trailing whitespace 299 297 * gets output from the last iteration of the format unit. 300 298 */ 301 299 for (fu = fs->nextfu; fu; fu = fu->nextfu) { 302 if (!fu->nextfu && fs->bcnt < dumper->blocksize 303 && !(fu->flags & F_SETREP) && fu->bcnt 300 if (!fu->nextfu 301 && fs->bcnt < dumper->blocksize 302 && !(fu->flags & F_SETREP) 303 && fu->bcnt 304 304 ) { 305 305 fu->reps += (dumper->blocksize - fs->bcnt) / fu->bcnt; 306 306 } 307 if (fu->reps > 1 ) {307 if (fu->reps > 1 && fu->nextpr) { 308 308 for (pr = fu->nextpr;; pr = pr->nextpr) 309 309 if (!pr->nextpr) … … 725 725 for (;;) { 726 726 p = skip_whitespace(p); 727 if ( !*p) {727 if (*p == '\0') { 728 728 break; 729 729 } … … 753 753 /* skip slash and trailing white space */ 754 754 if (*p == '/') { 755 p = skip_whitespace( ++p);755 p = skip_whitespace(p + 1); 756 756 } 757 757 … … 767 767 tfu->bcnt = atoi(savep); 768 768 /* skip trailing white space */ 769 p = skip_whitespace( ++p);769 p = skip_whitespace(p + 1); 770 770 } 771 771 … … 775 775 } 776 776 for (savep = ++p; *p != '"';) { 777 if (*p++ == 0) {777 if (*p++ == '\0') { 778 778 bb_error_msg_and_die("bad format {%s}", fmt); 779 779 } … … 786 786 /* alphabetic escape sequences have to be done in place */ 787 787 for (p2 = p1;; ++p1, ++p2) { 788 if ( !*p1) {788 if (*p1 == '\0') { 789 789 *p2 = *p1; 790 790 break;
Note:
See TracChangeset
for help on using the changeset viewer.