Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/libbb/dump.c


Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/libbb/dump.c

    r2725 r3232  
    7272             * case it's a %s format.
    7373             */
    74             while (strchr(index_str + 1, *++fmt));
     74            while (strchr(index_str + 1, *++fmt))
     75                continue;
    7576            if (*fmt == '.' && isdigit(*++fmt)) {
    7677                prec = atoi(fmt);
     
    100101{
    101102    enum { NOTOKAY, USEBCNT, USEPREC } sokay;
    102     PR *pr, **nextpr = NULL;
    103103    FU *fu;
     104    PR *pr;
    104105    char *p1, *p2, *p3;
    105106    char savech, *fmtp;
     
    112113         * conversion character gets its own.
    113114         */
    114         for (nconv = 0, fmtp = fu->fmt; *fmtp; nextpr = &pr->nextpr) {
     115        for (nconv = 0, fmtp = fu->fmt; *fmtp; ) {
    115116            /* NOSTRICT */
    116117            /* DBU:[dvae@cray.com] zalloc so that forward ptrs start out NULL*/
     
    118119            if (!fu->nextpr)
    119120                fu->nextpr = pr;
    120             /* ignore nextpr -- its unused inside the loop and is
    121              * uninitialized 1st time through.
    122              */
    123121
    124122            /* skip preceding text and up to the next % sign */
     
    296294     * repeat it as necessary.
    297295     *
    298      * if, rep count is greater than 1, no trailing whitespace
     296     * if rep count is greater than 1, no trailing whitespace
    299297     * gets output from the last iteration of the format unit.
    300298     */
    301299    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
    304304        ) {
    305305            fu->reps += (dumper->blocksize - fs->bcnt) / fu->bcnt;
    306306        }
    307         if (fu->reps > 1) {
     307        if (fu->reps > 1 && fu->nextpr) {
    308308            for (pr = fu->nextpr;; pr = pr->nextpr)
    309309                if (!pr->nextpr)
     
    725725    for (;;) {
    726726        p = skip_whitespace(p);
    727         if (!*p) {
     727        if (*p == '\0') {
    728728            break;
    729729        }
     
    753753        /* skip slash and trailing white space */
    754754        if (*p == '/') {
    755             p = skip_whitespace(++p);
     755            p = skip_whitespace(p + 1);
    756756        }
    757757
     
    767767            tfu->bcnt = atoi(savep);
    768768            /* skip trailing white space */
    769             p = skip_whitespace(++p);
     769            p = skip_whitespace(p + 1);
    770770        }
    771771
     
    775775        }
    776776        for (savep = ++p; *p != '"';) {
    777             if (*p++ == 0) {
     777            if (*p++ == '\0') {
    778778                bb_error_msg_and_die("bad format {%s}", fmt);
    779779            }
     
    786786        /* alphabetic escape sequences have to be done in place */
    787787        for (p2 = p1;; ++p1, ++p2) {
    788             if (!*p1) {
     788            if (*p1 == '\0') {
    789789                *p2 = *p1;
    790790                break;
Note: See TracChangeset for help on using the changeset viewer.