aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-28 02:24:24 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-28 02:24:24 +0100
commit6b9f1633537e2ff06eb1a0741e4598a294f40fcb (patch)
treea13f4f3558c2988bc95b5a59c9996da64a0bd570
parent17323a6245597f16321e6bf99536ae9bb89c79cf (diff)
downloadbusybox-w32-6b9f1633537e2ff06eb1a0741e4598a294f40fcb.tar.gz
busybox-w32-6b9f1633537e2ff06eb1a0741e4598a294f40fcb.tar.bz2
busybox-w32-6b9f1633537e2ff06eb1a0741e4598a294f40fcb.zip
*: style fixes. no code changes (verified with objdump)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--archival/bz/bzlib.c8
-rw-r--r--archival/dpkg.c10
-rw-r--r--archival/gzip.c8
-rw-r--r--archival/lzo1x_9x.c166
-rw-r--r--archival/lzop.c9
-rw-r--r--coreutils/dd.c7
-rw-r--r--editors/vi.c8
-rw-r--r--modutils/depmod.c6
-rw-r--r--modutils/modutils-24.c16
-rw-r--r--networking/libiproute/iproute.c19
-rw-r--r--networking/libiproute/iprule.c12
-rw-r--r--networking/libiproute/iptunnel.c19
-rw-r--r--networking/libiproute/libnetlink.c6
-rw-r--r--networking/libiproute/ll_addr.c5
-rw-r--r--networking/tc.c19
-rw-r--r--procps/pgrep.c7
-rw-r--r--shell/lash_unused.c13
-rw-r--r--shell/msh_unused.c7
-rw-r--r--util-linux/fsck_minix.c8
-rw-r--r--util-linux/mount.c8
-rw-r--r--util-linux/readprofile.c6
-rw-r--r--util-linux/volume_id/fat.c18
-rw-r--r--util-linux/volume_id/unused_msdos.c6
23 files changed, 231 insertions, 160 deletions
diff --git a/archival/bz/bzlib.c b/archival/bz/bzlib.c
index 9957c2fbd..834179403 100644
--- a/archival/bz/bzlib.c
+++ b/archival/bz/bzlib.c
@@ -393,10 +393,12 @@ int BZ2_bzBuffToBuffCompress(char* dest,
393 bz_stream strm; 393 bz_stream strm;
394 int ret; 394 int ret;
395 395
396 if (dest == NULL || destLen == NULL || 396 if (dest == NULL || destLen == NULL
397 source == NULL || 397 || source == NULL
398 blockSize100k < 1 || blockSize100k > 9) 398 || blockSize100k < 1 || blockSize100k > 9
399 ) {
399 return BZ_PARAM_ERROR; 400 return BZ_PARAM_ERROR;
401 }
400 402
401 BZ2_bzCompressInit(&strm, blockSize100k); 403 BZ2_bzCompressInit(&strm, blockSize100k);
402 404
diff --git a/archival/dpkg.c b/archival/dpkg.c
index 9f58b54e6..7187ad6a0 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -858,8 +858,9 @@ static void write_status_file(deb_file_t **deb_file)
858 if (field_name == NULL) { 858 if (field_name == NULL) {
859 break; 859 break;
860 } 860 }
861 if ((strcmp(field_name, "Priority") == 0) || 861 if ((strcmp(field_name, "Priority") == 0)
862 (strcmp(field_name, "Section") == 0)) { 862 || (strcmp(field_name, "Section") == 0)
863 ) {
863 fprintf(new_status_file, "%s: %s\n", field_name, field_value); 864 fprintf(new_status_file, "%s: %s\n", field_name, field_value);
864 } 865 }
865 } 866 }
@@ -1079,8 +1080,9 @@ static int check_deps(deb_file_t **deb_file, int deb_start /*, int dep_max_count
1079 1080
1080 package_num = search_package_hashtable(package_edge->name, package_edge->version, package_edge->operator); 1081 package_num = search_package_hashtable(package_edge->name, package_edge->version, package_edge->operator);
1081 1082
1082 if (package_edge->type == EDGE_PRE_DEPENDS || 1083 if (package_edge->type == EDGE_PRE_DEPENDS
1083 package_edge->type == EDGE_DEPENDS) { 1084 || package_edge->type == EDGE_DEPENDS
1085 ) {
1084 int result=1; 1086 int result=1;
1085 status_num = 0; 1087 status_num = 0;
1086 1088
diff --git a/archival/gzip.c b/archival/gzip.c
index 139eaacea..f9c8e4d4b 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -620,10 +620,12 @@ static int longest_match(IPos cur_match)
620 /* Skip to next match if the match length cannot increase 620 /* Skip to next match if the match length cannot increase
621 * or if the match length is less than 2: 621 * or if the match length is less than 2:
622 */ 622 */
623 if (match[best_len] != scan_end || 623 if (match[best_len] != scan_end
624 match[best_len - 1] != scan_end1 || 624 || match[best_len - 1] != scan_end1
625 *match != *scan || *++match != scan[1]) 625 || *match != *scan || *++match != scan[1]
626 ) {
626 continue; 627 continue;
628 }
627 629
628 /* The check at best_len-1 can be removed because it will be made 630 /* The check at best_len-1 can be removed because it will be made
629 * again later. (This heuristic is not always a win.) 631 * again later. (This heuristic is not always a win.)
diff --git a/archival/lzo1x_9x.c b/archival/lzo1x_9x.c
index f2d4fac1b..0baed5469 100644
--- a/archival/lzo1x_9x.c
+++ b/archival/lzo1x_9x.c
@@ -176,7 +176,7 @@ static int swd_init(lzo_swd_p s)
176 if (s->look > 0) { 176 if (s->look > 0) {
177 if (s->look > SWD_F) 177 if (s->look > SWD_F)
178 s->look = SWD_F; 178 s->look = SWD_F;
179 memcpy(&s->b[s->ip],s->c->ip,s->look); 179 memcpy(&s->b[s->ip], s->c->ip, s->look);
180 s->c->ip += s->look; 180 s->c->ip += s->look;
181 s->ip += s->look; 181 s->ip += s->look;
182 } 182 }
@@ -256,8 +256,8 @@ static void swd_accept(lzo_swd_p s, unsigned n)
256 swd_remove_node(s,s->rp); 256 swd_remove_node(s,s->rp);
257 257
258 /* add bp into HEAD3 */ 258 /* add bp into HEAD3 */
259 key = HEAD3(s->b,s->bp); 259 key = HEAD3(s->b, s->bp);
260 s->succ3[s->bp] = s_get_head3(s,key); 260 s->succ3[s->bp] = s_get_head3(s, key);
261 s->head3[key] = s->bp; 261 s->head3[key] = s->bp;
262 s->best3[s->bp] = SWD_F + 1; 262 s->best3[s->bp] = SWD_F + 1;
263 s->llen3[key]++; 263 s->llen3[key]++;
@@ -265,7 +265,7 @@ static void swd_accept(lzo_swd_p s, unsigned n)
265 265
266#ifdef HEAD2 266#ifdef HEAD2
267 /* add bp into HEAD2 */ 267 /* add bp into HEAD2 */
268 key = HEAD2(s->b,s->bp); 268 key = HEAD2(s->b, s->bp);
269 s->head2[key] = s->bp; 269 s->head2[key] = s->bp;
270#endif 270#endif
271 271
@@ -298,18 +298,19 @@ static void swd_search(lzo_swd_p s, unsigned node, unsigned cnt)
298 298
299 assert(m_len < s->look); 299 assert(m_len < s->look);
300 300
301 if (p2[m_len - 1] == scan_end1 && 301 if (p2[m_len - 1] == scan_end1
302 p2[m_len] == p1[m_len] && 302 && p2[m_len] == p1[m_len]
303 p2[0] == p1[0] && 303 && p2[0] == p1[0]
304 p2[1] == p1[1]) { 304 && p2[1] == p1[1]
305 ) {
305 unsigned i; 306 unsigned i;
306 assert(lzo_memcmp(bp,&b[node],3) == 0); 307 assert(lzo_memcmp(bp, &b[node], 3) == 0);
307 308
308 p1 += 2; p2 += 2; 309 p1 += 2; p2 += 2;
309 do {} while (++p1 < px && *p1 == *++p2); 310 do {} while (++p1 < px && *p1 == *++p2);
310 i = p1-bp; 311 i = p1-bp;
311 312
312 assert(lzo_memcmp(bp,&b[node],i) == 0); 313 assert(lzo_memcmp(bp, &b[node], i) == 0);
313 314
314#if defined(SWD_BEST_OFF) 315#if defined(SWD_BEST_OFF)
315 if (i < SWD_BEST_OFF) { 316 if (i < SWD_BEST_OFF) {
@@ -345,10 +346,10 @@ static int swd_search2(lzo_swd_p s)
345 assert(s->look >= 2); 346 assert(s->look >= 2);
346 assert(s->m_len > 0); 347 assert(s->m_len > 0);
347 348
348 key = s->head2[ HEAD2(s->b,s->bp) ]; 349 key = s->head2[HEAD2(s->b, s->bp)];
349 if (key == NIL2) 350 if (key == NIL2)
350 return 0; 351 return 0;
351 assert(lzo_memcmp(&s->b[s->bp],&s->b[key],2) == 0); 352 assert(lzo_memcmp(&s->b[s->bp], &s->b[key], 2) == 0);
352#if defined(SWD_BEST_OFF) 353#if defined(SWD_BEST_OFF)
353 if (s->best_pos[2] == 0) 354 if (s->best_pos[2] == 0)
354 s->best_pos[2] = key + 1; 355 s->best_pos[2] = key + 1;
@@ -377,7 +378,7 @@ static void swd_findbest(lzo_swd_p s)
377 378
378 /* get current head, add bp into HEAD3 */ 379 /* get current head, add bp into HEAD3 */
379 key = HEAD3(s->b,s->bp); 380 key = HEAD3(s->b,s->bp);
380 node = s->succ3[s->bp] = s_get_head3(s,key); 381 node = s->succ3[s->bp] = s_get_head3(s, key);
381 cnt = s->llen3[key]++; 382 cnt = s->llen3[key]++;
382 assert(s->llen3[key] <= SWD_N + SWD_F); 383 assert(s->llen3[key] <= SWD_N + SWD_F);
383 if (cnt > s->max_chain) 384 if (cnt > s->max_chain)
@@ -396,7 +397,7 @@ static void swd_findbest(lzo_swd_p s)
396 if (swd_search2(s)) 397 if (swd_search2(s))
397#endif 398#endif
398 if (s->look >= 3) 399 if (s->look >= 3)
399 swd_search(s,node,cnt); 400 swd_search(s, node, cnt);
400 if (s->m_len > len) 401 if (s->m_len > len)
401 s->m_off = swd_pos2off(s,s->m_pos); 402 s->m_off = swd_pos2off(s,s->m_pos);
402 s->best3[s->bp] = s->m_len; 403 s->best3[s->bp] = s->m_len;
@@ -404,11 +405,12 @@ static void swd_findbest(lzo_swd_p s)
404#if defined(SWD_BEST_OFF) 405#if defined(SWD_BEST_OFF)
405 if (s->use_best_off) { 406 if (s->use_best_off) {
406 int i; 407 int i;
407 for (i = 2; i < SWD_BEST_OFF; i++) 408 for (i = 2; i < SWD_BEST_OFF; i++) {
408 if (s->best_pos[i] > 0) 409 if (s->best_pos[i] > 0)
409 s->best_off[i] = swd_pos2off(s,s->best_pos[i]-1); 410 s->best_off[i] = swd_pos2off(s, s->best_pos[i]-1);
410 else 411 else
411 s->best_off[i] = 0; 412 s->best_off[i] = 0;
413 }
412 } 414 }
413#endif 415#endif
414 } 416 }
@@ -417,7 +419,7 @@ static void swd_findbest(lzo_swd_p s)
417 419
418#ifdef HEAD2 420#ifdef HEAD2
419 /* add bp into HEAD2 */ 421 /* add bp into HEAD2 */
420 key = HEAD2(s->b,s->bp); 422 key = HEAD2(s->b, s->bp);
421 s->head2[key] = s->bp; 423 s->head2[key] = s->bp;
422#endif 424#endif
423} 425}
@@ -467,7 +469,7 @@ static int find_match(lzo1x_999_t *c, lzo_swd_p s,
467 s->m_len = 1; 469 s->m_len = 1;
468#ifdef SWD_BEST_OFF 470#ifdef SWD_BEST_OFF
469 if (s->use_best_off) 471 if (s->use_best_off)
470 memset(s->best_pos,0,sizeof(s->best_pos)); 472 memset(s->best_pos, 0, sizeof(s->best_pos));
471#endif 473#endif
472 swd_findbest(s); 474 swd_findbest(s);
473 c->m_len = s->m_len; 475 c->m_len = s->m_len;
@@ -505,7 +507,8 @@ static uint8_t *code_match(lzo1x_999_t *c,
505 assert(op > c->out); 507 assert(op > c->out);
506 if (m_len == 2) { 508 if (m_len == 2) {
507 assert(m_off <= M1_MAX_OFFSET); 509 assert(m_off <= M1_MAX_OFFSET);
508 assert(c->r1_lit > 0); assert(c->r1_lit < 4); 510 assert(c->r1_lit > 0);
511 assert(c->r1_lit < 4);
509 m_off -= 1; 512 m_off -= 1;
510 *op++ = M1_MARKER | ((m_off & 3) << 2); 513 *op++ = M1_MARKER | ((m_off & 3) << 2);
511 *op++ = m_off >> 2; 514 *op++ = m_off >> 2;
@@ -529,11 +532,10 @@ static uint8_t *code_match(lzo1x_999_t *c,
529 else { 532 else {
530 m_len -= M3_MAX_LEN; 533 m_len -= M3_MAX_LEN;
531 *op++ = M3_MARKER | 0; 534 *op++ = M3_MARKER | 0;
532 while (m_len > 255) 535 while (m_len > 255) {
533 { 536 m_len -= 255;
534 m_len -= 255; 537 *op++ = 0;
535 *op++ = 0; 538 }
536 }
537 assert(m_len > 0); 539 assert(m_len > 0);
538 *op++ = m_len; 540 *op++ = m_len;
539 } 541 }
@@ -543,7 +545,8 @@ static uint8_t *code_match(lzo1x_999_t *c,
543 unsigned k; 545 unsigned k;
544 546
545 assert(m_len >= 3); 547 assert(m_len >= 3);
546 assert(m_off > 0x4000); assert(m_off <= 0xbfff); 548 assert(m_off > 0x4000);
549 assert(m_off <= 0xbfff);
547 m_off -= 0x4000; 550 m_off -= 0x4000;
548 k = (m_off & 0x4000) >> 11; 551 k = (m_off & 0x4000) >> 11;
549 if (m_len <= M4_MAX_LEN) 552 if (m_len <= M4_MAX_LEN)
@@ -551,11 +554,10 @@ static uint8_t *code_match(lzo1x_999_t *c,
551 else { 554 else {
552 m_len -= M4_MAX_LEN; 555 m_len -= M4_MAX_LEN;
553 *op++ = M4_MARKER | k | 0; 556 *op++ = M4_MARKER | k | 0;
554 while (m_len > 255) 557 while (m_len > 255) {
555 { 558 m_len -= 255;
556 m_len -= 255; 559 *op++ = 0;
557 *op++ = 0; 560 }
558 }
559 assert(m_len > 0); 561 assert(m_len > 0);
560 *op++ = m_len; 562 *op++ = m_len;
561 } 563 }
@@ -598,7 +600,7 @@ static uint8_t *code_run(lzo1x_999_t *c, uint8_t *op, const uint8_t *ii,
598{ 600{
599 if (lit > 0) { 601 if (lit > 0) {
600 assert(m_len >= 2); 602 assert(m_len >= 2);
601 op = STORE_RUN(c,op,ii,lit); 603 op = STORE_RUN(c, op, ii, lit);
602 } else { 604 } else {
603 assert(m_len >= 3); 605 assert(m_len >= 3);
604 } 606 }
@@ -681,32 +683,32 @@ static void better_match(const lzo_swd_p swd,
681 return; 683 return;
682 684
683 /* M3/M4 -> M2 */ 685 /* M3/M4 -> M2 */
684 if (*m_off > M2_MAX_OFFSET && 686 if (*m_off > M2_MAX_OFFSET
685 *m_len >= M2_MIN_LEN + 1 && *m_len <= M2_MAX_LEN + 1 && 687 && *m_len >= M2_MIN_LEN + 1 && *m_len <= M2_MAX_LEN + 1
686 swd->best_off[*m_len-1] && swd->best_off[*m_len-1] <= M2_MAX_OFFSET) 688 && swd->best_off[*m_len-1] && swd->best_off[*m_len-1] <= M2_MAX_OFFSET
687 { 689 ) {
688 *m_len = *m_len - 1; 690 *m_len = *m_len - 1;
689 *m_off = swd->best_off[*m_len]; 691 *m_off = swd->best_off[*m_len];
690 return; 692 return;
691 } 693 }
692 694
693 /* M4 -> M2 */ 695 /* M4 -> M2 */
694 if (*m_off > M3_MAX_OFFSET && 696 if (*m_off > M3_MAX_OFFSET
695 *m_len >= M4_MAX_LEN + 1 && *m_len <= M2_MAX_LEN + 2 && 697 && *m_len >= M4_MAX_LEN + 1 && *m_len <= M2_MAX_LEN + 2
696 swd->best_off[*m_len-2] && swd->best_off[*m_len-2] <= M2_MAX_OFFSET) 698 && swd->best_off[*m_len-2] && swd->best_off[*m_len-2] <= M2_MAX_OFFSET
697 { 699 ) {
698 *m_len = *m_len - 2; 700 *m_len = *m_len - 2;
699 *m_off = swd->best_off[*m_len]; 701 *m_off = swd->best_off[*m_len];
700 return; 702 return;
701 } 703 }
702 /* M4 -> M3 */ 704 /* M4 -> M3 */
703 if (*m_off > M3_MAX_OFFSET && 705 if (*m_off > M3_MAX_OFFSET
704 *m_len >= M4_MAX_LEN + 1 && *m_len <= M3_MAX_LEN + 1 && 706 && *m_len >= M4_MAX_LEN + 1 && *m_len <= M3_MAX_LEN + 1
705 swd->best_off[*m_len-1] && swd->best_off[*m_len-1] <= M3_MAX_OFFSET) 707 && swd->best_off[*m_len-1] && swd->best_off[*m_len-1] <= M3_MAX_OFFSET
706 { 708 ) {
707 *m_len = *m_len - 1; 709 *m_len = *m_len - 1;
708 *m_off = swd->best_off[*m_len]; 710 *m_off = swd->best_off[*m_len];
709 } 711 }
710} 712}
711 713
712#endif 714#endif
@@ -728,8 +730,8 @@ static int lzo1x_999_compress_internal(const uint8_t *in, unsigned in_len,
728 unsigned lit; 730 unsigned lit;
729 unsigned m_len, m_off; 731 unsigned m_len, m_off;
730 lzo1x_999_t cc; 732 lzo1x_999_t cc;
731 lzo1x_999_t * const c = &cc; 733 lzo1x_999_t *const c = &cc;
732 lzo_swd_p const swd = (lzo_swd_p) wrkmem; 734 const lzo_swd_p swd = (lzo_swd_p) wrkmem;
733 int r; 735 int r;
734 736
735 c->init = 0; 737 c->init = 0;
@@ -766,18 +768,18 @@ static int lzo1x_999_compress_internal(const uint8_t *in, unsigned in_len,
766 assert(ii + lit == c->bp); 768 assert(ii + lit == c->bp);
767 assert(swd->b_char == *(c->bp)); 769 assert(swd->b_char == *(c->bp));
768 770
769 if ( m_len < 2 || 771 if (m_len < 2
770 (m_len == 2 && (m_off > M1_MAX_OFFSET || lit == 0 || lit >= 4)) || 772 || (m_len == 2 && (m_off > M1_MAX_OFFSET || lit == 0 || lit >= 4))
771 /* Do not accept this match for compressed-data compatibility 773 /* Do not accept this match for compressed-data compatibility
772 * with LZO v1.01 and before 774 * with LZO v1.01 and before
773 * [ might be a problem for decompress() and optimize() ] 775 * [ might be a problem for decompress() and optimize() ]
774 */ 776 */
775 (m_len == 2 && op == out) || 777 || (m_len == 2 && op == out)
776 (op == out && lit == 0)) 778 || (op == out && lit == 0)
777 { 779 ) {
778 /* a literal */ 780 /* a literal */
779 m_len = 0; 781 m_len = 0;
780 } 782 }
781 else if (m_len == M2_MIN_LEN) { 783 else if (m_len == M2_MIN_LEN) {
782 /* compression ratio improves if we code a literal in some cases */ 784 /* compression ratio improves if we code a literal in some cases */
783 if (m_off > MX_MAX_OFFSET && lit >= 4) 785 if (m_off > MX_MAX_OFFSET && lit >= 4)
@@ -788,7 +790,7 @@ static int lzo1x_999_compress_internal(const uint8_t *in, unsigned in_len,
788 /* a literal */ 790 /* a literal */
789 lit++; 791 lit++;
790 swd->max_chain = max_chain; 792 swd->max_chain = max_chain;
791 r = find_match(c,swd,1,0); 793 r = find_match(c, swd, 1, 0);
792 assert(r == 0); 794 assert(r == 0);
793 continue; 795 continue;
794 } 796 }
@@ -796,7 +798,7 @@ static int lzo1x_999_compress_internal(const uint8_t *in, unsigned in_len,
796 /* a match */ 798 /* a match */
797#if defined(SWD_BEST_OFF) 799#if defined(SWD_BEST_OFF)
798 if (swd->use_best_off) 800 if (swd->use_best_off)
799 better_match(swd,&m_len,&m_off); 801 better_match(swd, &m_len, &m_off);
800#endif 802#endif
801 803
802 /* shall we try a lazy match ? */ 804 /* shall we try a lazy match ? */
@@ -807,7 +809,7 @@ static int lzo1x_999_compress_internal(const uint8_t *in, unsigned in_len,
807 max_ahead = 0; 809 max_ahead = 0;
808 } else { 810 } else {
809 /* yes, try a lazy match */ 811 /* yes, try a lazy match */
810 l1 = len_of_coded_match(m_len,m_off,lit); 812 l1 = len_of_coded_match(m_len, m_off, lit);
811 assert(l1 > 0); 813 assert(l1 > 0);
812 max_ahead = LZO_MIN(2, (unsigned)l1 - 1); 814 max_ahead = LZO_MIN(2, (unsigned)l1 - 1);
813 } 815 }
@@ -820,7 +822,7 @@ static int lzo1x_999_compress_internal(const uint8_t *in, unsigned in_len,
820 swd->max_chain = max_chain >> 2; 822 swd->max_chain = max_chain >> 2;
821 else 823 else
822 swd->max_chain = max_chain; 824 swd->max_chain = max_chain;
823 r = find_match(c,swd,1,0); 825 r = find_match(c, swd, 1, 0);
824 ahead++; 826 ahead++;
825 827
826 assert(r == 0); 828 assert(r == 0);
@@ -833,23 +835,23 @@ static int lzo1x_999_compress_internal(const uint8_t *in, unsigned in_len,
833 continue; 835 continue;
834#if defined(SWD_BEST_OFF) 836#if defined(SWD_BEST_OFF)
835 if (swd->use_best_off) 837 if (swd->use_best_off)
836 better_match(swd,&c->m_len,&c->m_off); 838 better_match(swd, &c->m_len, &c->m_off);
837#endif 839#endif
838 l2 = len_of_coded_match(c->m_len,c->m_off,lit+ahead); 840 l2 = len_of_coded_match(c->m_len, c->m_off, lit+ahead);
839 if (l2 < 0) 841 if (l2 < 0)
840 continue; 842 continue;
841 843
842 /* compressed-data compatibility [see above] */ 844 /* compressed-data compatibility [see above] */
843 l3 = (op == out) ? -1 : len_of_coded_match(ahead,m_off,lit); 845 l3 = (op == out) ? -1 : len_of_coded_match(ahead, m_off, lit);
844 846
845 lazy_match_min_gain = min_gain(ahead,lit,lit+ahead,l1,l2,l3); 847 lazy_match_min_gain = min_gain(ahead, lit, lit+ahead, l1, l2, l3);
846 if (c->m_len >= m_len + lazy_match_min_gain) { 848 if (c->m_len >= m_len + lazy_match_min_gain) {
847 if (l3 > 0) { 849 if (l3 > 0) {
848 /* code previous run */ 850 /* code previous run */
849 op = code_run(c,op,ii,lit); 851 op = code_run(c, op, ii, lit);
850 lit = 0; 852 lit = 0;
851 /* code shortened match */ 853 /* code shortened match */
852 op = code_match(c,op,ahead,m_off); 854 op = code_match(c, op, ahead, m_off);
853 } else { 855 } else {
854 lit += ahead; 856 lit += ahead;
855 assert(ii + lit == c->bp); 857 assert(ii + lit == c->bp);
@@ -861,13 +863,13 @@ static int lzo1x_999_compress_internal(const uint8_t *in, unsigned in_len,
861 assert(ii + lit + ahead == c->bp); 863 assert(ii + lit + ahead == c->bp);
862 864
863 /* 1 - code run */ 865 /* 1 - code run */
864 op = code_run(c,op,ii,lit); 866 op = code_run(c, op, ii, lit);
865 lit = 0; 867 lit = 0;
866 868
867 /* 2 - code match */ 869 /* 2 - code match */
868 op = code_match(c,op,m_len,m_off); 870 op = code_match(c, op, m_len, m_off);
869 swd->max_chain = max_chain; 871 swd->max_chain = max_chain;
870 r = find_match(c,swd,m_len,1+ahead); 872 r = find_match(c, swd, m_len, 1+ahead);
871 assert(r == 0); 873 assert(r == 0);
872 874
873 lazy_match_done: ; 875 lazy_match_done: ;
@@ -875,7 +877,7 @@ static int lzo1x_999_compress_internal(const uint8_t *in, unsigned in_len,
875 877
876 /* store final run */ 878 /* store final run */
877 if (lit > 0) 879 if (lit > 0)
878 op = STORE_RUN(c,op,ii,lit); 880 op = STORE_RUN(c, op, ii, lit);
879 881
880#if defined(LZO_EOF_CODE) 882#if defined(LZO_EOF_CODE)
881 *op++ = M4_MARKER | 1; 883 *op++ = M4_MARKER | 1;
diff --git a/archival/lzop.c b/archival/lzop.c
index 46aa2d3d1..a752a9d89 100644
--- a/archival/lzop.c
+++ b/archival/lzop.c
@@ -166,9 +166,12 @@ static NOINLINE int lzo1x_optimize(uint8_t *in, unsigned in_len,
166 o_m1_a++; 166 o_m1_a++;
167 } 167 }
168 /* test if a literal run follows */ 168 /* test if a literal run follows */
169 else if (nl == 0 && ip[0] < 16 && ip[0] != 0 && 169 else
170 (lit + 2 + ip[0] < 16)) 170 if (nl == 0
171 { 171 && ip[0] < 16
172 && ip[0] != 0
173 && (lit + 2 + ip[0] < 16)
174 ) {
172 t = *ip++; 175 t = *ip++;
173 /* remove short run */ 176 /* remove short run */
174 *litp &= ~3; 177 *litp &= ~3;
diff --git a/coreutils/dd.c b/coreutils/dd.c
index f1e63fd8b..8173d403d 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -301,9 +301,12 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
301 if (ftruncate(ofd, seek * obs) < 0) { 301 if (ftruncate(ofd, seek * obs) < 0) {
302 struct stat st; 302 struct stat st;
303 303
304 if (fstat(ofd, &st) < 0 || S_ISREG(st.st_mode) || 304 if (fstat(ofd, &st) < 0
305 S_ISDIR(st.st_mode)) 305 || S_ISREG(st.st_mode)
306 || S_ISDIR(st.st_mode)
307 ) {
306 goto die_outfile; 308 goto die_outfile;
309 }
307 } 310 }
308 } 311 }
309 } else { 312 } else {
diff --git a/editors/vi.c b/editors/vi.c
index 58c6f5a05..c4bca2a9c 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -1158,9 +1158,11 @@ static void colon(char *buf)
1158 file_modified = 0; 1158 file_modified = 0;
1159 last_file_modified = -1; 1159 last_file_modified = -1;
1160 } 1160 }
1161 if ((cmd[0] == 'x' || cmd[1] == 'q' || cmd[1] == 'n' || 1161 if ((cmd[0] == 'x' || cmd[1] == 'q' || cmd[1] == 'n'
1162 cmd[0] == 'X' || cmd[1] == 'Q' || cmd[1] == 'N') 1162 || cmd[0] == 'X' || cmd[1] == 'Q' || cmd[1] == 'N'
1163 && l == ch) { 1163 )
1164 && l == ch
1165 ) {
1164 editing = 0; 1166 editing = 0;
1165 } 1167 }
1166 } 1168 }
diff --git a/modutils/depmod.c b/modutils/depmod.c
index d6cc8ed59..4718c4dcb 100644
--- a/modutils/depmod.c
+++ b/modutils/depmod.c
@@ -80,9 +80,11 @@ static int FAST_FUNC parse_module(const char *fname, struct stat *sb UNUSED_PARA
80 && strncmp(ptr, "__ksymtab_", 10) == 0 80 && strncmp(ptr, "__ksymtab_", 10) == 0
81 ) { 81 ) {
82 ptr += 10; 82 ptr += 10;
83 if (strncmp(ptr, "gpl", 3) == 0 || 83 if (strncmp(ptr, "gpl", 3) == 0
84 strcmp(ptr, "strings") == 0) 84 || strcmp(ptr, "strings") == 0
85 ) {
85 continue; 86 continue;
87 }
86 llist_add_to(&info->symbols, xstrdup(ptr)); 88 llist_add_to(&info->symbols, xstrdup(ptr));
87 ptr += strlen(ptr); 89 ptr += strlen(ptr);
88 } 90 }
diff --git a/modutils/modutils-24.c b/modutils/modutils-24.c
index a878e740c..4ede01fe8 100644
--- a/modutils/modutils-24.c
+++ b/modutils/modutils-24.c
@@ -865,19 +865,23 @@ arch_apply_relocation(struct obj_file *f,
865 break; 865 break;
866 case R_H8_PCREL16: 866 case R_H8_PCREL16:
867 v -= dot + 2; 867 v -= dot + 2;
868 if ((ElfW(Sword))v > 0x7fff || 868 if ((ElfW(Sword))v > 0x7fff
869 (ElfW(Sword))v < -(ElfW(Sword))0x8000) 869 || (ElfW(Sword))v < -(ElfW(Sword))0x8000
870 ) {
870 ret = obj_reloc_overflow; 871 ret = obj_reloc_overflow;
871 else 872 } else {
872 *(unsigned short *)loc = v; 873 *(unsigned short *)loc = v;
874 }
873 break; 875 break;
874 case R_H8_PCREL8: 876 case R_H8_PCREL8:
875 v -= dot + 1; 877 v -= dot + 1;
876 if ((ElfW(Sword))v > 0x7f || 878 if ((ElfW(Sword))v > 0x7f
877 (ElfW(Sword))v < -(ElfW(Sword))0x80) 879 || (ElfW(Sword))v < -(ElfW(Sword))0x80
880 ) {
878 ret = obj_reloc_overflow; 881 ret = obj_reloc_overflow;
879 else 882 } else {
880 *(unsigned char *)loc = v; 883 *(unsigned char *)loc = v;
884 }
881 break; 885 break;
882 886
883#elif defined(__i386__) 887#elif defined(__i386__)
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index c4b3450dd..520cc820a 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -163,20 +163,27 @@ static int FAST_FUNC print_route(const struct sockaddr_nl *who UNUSED_PARAM,
163 memset(tb, 0, sizeof(tb)); 163 memset(tb, 0, sizeof(tb));
164 parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len); 164 parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len);
165 165
166 if (G_filter.rdst.family && inet_addr_match(&dst, &G_filter.rdst, G_filter.rdst.bitlen)) 166 if (G_filter.rdst.family
167 && inet_addr_match(&dst, &G_filter.rdst, G_filter.rdst.bitlen)
168 ) {
167 return 0; 169 return 0;
168 if (G_filter.mdst.family && G_filter.mdst.bitlen >= 0 && 170 }
169 inet_addr_match(&dst, &G_filter.mdst, r->rtm_dst_len)) 171 if (G_filter.mdst.family
172 && G_filter.mdst.bitlen >= 0
173 && inet_addr_match(&dst, &G_filter.mdst, r->rtm_dst_len)
174 ) {
170 return 0; 175 return 0;
171 176 }
172 if (G_filter.rsrc.family && inet_addr_match(&src, &G_filter.rsrc, G_filter.rsrc.bitlen)) 177 if (G_filter.rsrc.family
178 && inet_addr_match(&src, &G_filter.rsrc, G_filter.rsrc.bitlen)
179 ) {
173 return 0; 180 return 0;
181 }
174 if (G_filter.msrc.family && G_filter.msrc.bitlen >= 0 182 if (G_filter.msrc.family && G_filter.msrc.bitlen >= 0
175 && inet_addr_match(&src, &G_filter.msrc, r->rtm_src_len) 183 && inet_addr_match(&src, &G_filter.msrc, r->rtm_src_len)
176 ) { 184 ) {
177 return 0; 185 return 0;
178 } 186 }
179
180 if (G_filter.flushb 187 if (G_filter.flushb
181 && r->rtm_family == AF_INET6 188 && r->rtm_family == AF_INET6
182 && r->rtm_dst_len == 0 189 && r->rtm_dst_len == 0
diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c
index e7674530c..535019d87 100644
--- a/networking/libiproute/iprule.c
+++ b/networking/libiproute/iprule.c
@@ -233,7 +233,8 @@ static int iprule_modify(int cmd, char **argv)
233 addattr_l(&req.n, sizeof(req), RTA_DST, &dst.data, dst.bytelen); 233 addattr_l(&req.n, sizeof(req), RTA_DST, &dst.data, dst.bytelen);
234 } else if (key == ARG_preference || 234 } else if (key == ARG_preference ||
235 key == ARG_order || 235 key == ARG_order ||
236 key == ARG_priority) { 236 key == ARG_priority
237 ) {
237 uint32_t pref; 238 uint32_t pref;
238 NEXT_ARG(); 239 NEXT_ARG();
239 pref = get_u32(*argv, "preference"); 240 pref = get_u32(*argv, "preference");
@@ -256,7 +257,8 @@ static int iprule_modify(int cmd, char **argv)
256 invarg(*argv, "realms"); 257 invarg(*argv, "realms");
257 addattr32(&req.n, sizeof(req), RTA_FLOW, realm); 258 addattr32(&req.n, sizeof(req), RTA_FLOW, realm);
258 } else if (key == ARG_table || 259 } else if (key == ARG_table ||
259 key == ARG_lookup) { 260 key == ARG_lookup
261 ) {
260 uint32_t tid; 262 uint32_t tid;
261 NEXT_ARG(); 263 NEXT_ARG();
262 if (rtnl_rttable_a2n(&tid, *argv)) 264 if (rtnl_rttable_a2n(&tid, *argv))
@@ -264,11 +266,13 @@ static int iprule_modify(int cmd, char **argv)
264 req.r.rtm_table = tid; 266 req.r.rtm_table = tid;
265 table_ok = 1; 267 table_ok = 1;
266 } else if (key == ARG_dev || 268 } else if (key == ARG_dev ||
267 key == ARG_iif) { 269 key == ARG_iif
270 ) {
268 NEXT_ARG(); 271 NEXT_ARG();
269 addattr_l(&req.n, sizeof(req), RTA_IIF, *argv, strlen(*argv)+1); 272 addattr_l(&req.n, sizeof(req), RTA_IIF, *argv, strlen(*argv)+1);
270 } else if (key == ARG_nat || 273 } else if (key == ARG_nat ||
271 key == ARG_map_to) { 274 key == ARG_map_to
275 ) {
272 NEXT_ARG(); 276 NEXT_ARG();
273 addattr32(&req.n, sizeof(req), RTA_GATEWAY, get_addr32(*argv)); 277 addattr32(&req.n, sizeof(req), RTA_GATEWAY, get_addr32(*argv));
274 req.r.rtm_type = RTN_NAT; 278 req.r.rtm_type = RTN_NAT;
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c
index 67afd1bfd..c36c7136f 100644
--- a/networking/libiproute/iptunnel.c
+++ b/networking/libiproute/iptunnel.c
@@ -204,19 +204,22 @@ static void parse_args(char **argv, int cmd, struct ip_tunnel_parm *p)
204 NEXT_ARG(); 204 NEXT_ARG();
205 key = index_in_strings(keywords, *argv); 205 key = index_in_strings(keywords, *argv);
206 if (key == ARG_ipip || 206 if (key == ARG_ipip ||
207 key == ARG_ip_ip) { 207 key == ARG_ip_ip
208 ) {
208 if (p->iph.protocol && p->iph.protocol != IPPROTO_IPIP) { 209 if (p->iph.protocol && p->iph.protocol != IPPROTO_IPIP) {
209 bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one"); 210 bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one");
210 } 211 }
211 p->iph.protocol = IPPROTO_IPIP; 212 p->iph.protocol = IPPROTO_IPIP;
212 } else if (key == ARG_gre || 213 } else if (key == ARG_gre ||
213 key == ARG_gre_ip) { 214 key == ARG_gre_ip
215 ) {
214 if (p->iph.protocol && p->iph.protocol != IPPROTO_GRE) { 216 if (p->iph.protocol && p->iph.protocol != IPPROTO_GRE) {
215 bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one"); 217 bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one");
216 } 218 }
217 p->iph.protocol = IPPROTO_GRE; 219 p->iph.protocol = IPPROTO_GRE;
218 } else if (key == ARG_sit || 220 } else if (key == ARG_sit ||
219 key == ARG_ip6_ip) { 221 key == ARG_ip6_ip
222 ) {
220 if (p->iph.protocol && p->iph.protocol != IPPROTO_IPV6) { 223 if (p->iph.protocol && p->iph.protocol != IPPROTO_IPV6) {
221 bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one"); 224 bb_error_msg_and_die("%s tunnel mode", "you managed to ask for more than one");
222 } 225 }
@@ -297,7 +300,8 @@ static void parse_args(char **argv, int cmd, struct ip_tunnel_parm *p)
297 p->iph.ttl = uval; 300 p->iph.ttl = uval;
298 } 301 }
299 } else if (key == ARG_tos || 302 } else if (key == ARG_tos ||
300 key == ARG_dsfield) { 303 key == ARG_dsfield
304 ) {
301 uint32_t uval; 305 uint32_t uval;
302 NEXT_ARG(); 306 NEXT_ARG();
303 key = index_in_strings(keywords, *argv); 307 key = index_in_strings(keywords, *argv);
@@ -485,7 +489,8 @@ static void do_tunnels_list(struct ip_tunnel_parm *p)
485 /*buf[sizeof(buf) - 1] = 0; - fgets is safe anyway */ 489 /*buf[sizeof(buf) - 1] = 0; - fgets is safe anyway */
486 ptr = strchr(buf, ':'); 490 ptr = strchr(buf, ':');
487 if (ptr == NULL || 491 if (ptr == NULL ||
488 (*ptr++ = 0, sscanf(buf, "%s", name) != 1)) { 492 (*ptr++ = 0, sscanf(buf, "%s", name) != 1)
493 ) {
489 bb_error_msg("wrong format of /proc/net/dev"); 494 bb_error_msg("wrong format of /proc/net/dev");
490 return; 495 return;
491 } 496 }
@@ -511,8 +516,10 @@ static void do_tunnels_list(struct ip_tunnel_parm *p)
511 (p->name[0] && strcmp(p1.name, p->name)) || 516 (p->name[0] && strcmp(p1.name, p->name)) ||
512 (p->iph.daddr && p1.iph.daddr != p->iph.daddr) || 517 (p->iph.daddr && p1.iph.daddr != p->iph.daddr) ||
513 (p->iph.saddr && p1.iph.saddr != p->iph.saddr) || 518 (p->iph.saddr && p1.iph.saddr != p->iph.saddr) ||
514 (p->i_key && p1.i_key != p->i_key)) 519 (p->i_key && p1.i_key != p->i_key)
520 ) {
515 continue; 521 continue;
522 }
516 print_tunnel(&p1); 523 print_tunnel(&p1);
517 bb_putchar('\n'); 524 bb_putchar('\n');
518 } 525 }
diff --git a/networking/libiproute/libnetlink.c b/networking/libiproute/libnetlink.c
index 9e6467de5..ba24832d6 100644
--- a/networking/libiproute/libnetlink.c
+++ b/networking/libiproute/libnetlink.c
@@ -147,7 +147,8 @@ static int rtnl_dump_filter(struct rtnl_handle *rth,
147 147
148 if (nladdr.nl_pid != 0 || 148 if (nladdr.nl_pid != 0 ||
149 h->nlmsg_pid != rth->local.nl_pid || 149 h->nlmsg_pid != rth->local.nl_pid ||
150 h->nlmsg_seq != rth->dump) { 150 h->nlmsg_seq != rth->dump
151 ) {
151// if (junk) { 152// if (junk) {
152// err = junk(&nladdr, h, arg2); 153// err = junk(&nladdr, h, arg2);
153// if (err < 0) { 154// if (err < 0) {
@@ -281,7 +282,8 @@ int FAST_FUNC rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
281 282
282 if (nladdr.nl_pid != peer || 283 if (nladdr.nl_pid != peer ||
283 h->nlmsg_pid != rtnl->local.nl_pid || 284 h->nlmsg_pid != rtnl->local.nl_pid ||
284 h->nlmsg_seq != seq) { 285 h->nlmsg_seq != seq
286 ) {
285// if (junk) { 287// if (junk) {
286// l_err = junk(&nladdr, h, jarg); 288// l_err = junk(&nladdr, h, jarg);
287// if (l_err < 0) { 289// if (l_err < 0) {
diff --git a/networking/libiproute/ll_addr.c b/networking/libiproute/ll_addr.c
index f59831cc1..c2c01305d 100644
--- a/networking/libiproute/ll_addr.c
+++ b/networking/libiproute/ll_addr.c
@@ -22,8 +22,9 @@ const char* FAST_FUNC ll_addr_n2a(unsigned char *addr, int alen, int type, char
22 int i; 22 int i;
23 int l; 23 int l;
24 24
25 if (alen == 4 && 25 if (alen == 4
26 (type == ARPHRD_TUNNEL || type == ARPHRD_SIT || type == ARPHRD_IPGRE)) { 26 && (type == ARPHRD_TUNNEL || type == ARPHRD_SIT || type == ARPHRD_IPGRE)
27 ) {
27 return inet_ntop(AF_INET, addr, buf, blen); 28 return inet_ntop(AF_INET, addr, buf, blen);
28 } 29 }
29 l = 0; 30 l = 0;
diff --git a/networking/tc.c b/networking/tc.c
index dbdba3317..541a0f8f4 100644
--- a/networking/tc.c
+++ b/networking/tc.c
@@ -470,17 +470,22 @@ int tc_main(int argc UNUSED_PARAM, char **argv)
470 msg.tcm_ifindex = xll_name_to_index(dev); 470 msg.tcm_ifindex = xll_name_to_index(dev);
471 if (cmd >= CMD_show) 471 if (cmd >= CMD_show)
472 filter_ifindex = msg.tcm_ifindex; 472 filter_ifindex = msg.tcm_ifindex;
473 } else if ((arg == ARG_qdisc && obj == OBJ_class && cmd >= CMD_show) 473 } else
474 || (arg == ARG_handle && obj == OBJ_qdisc 474 if ((arg == ARG_qdisc && obj == OBJ_class && cmd >= CMD_show)
475 && cmd == CMD_change)) { 475 || (arg == ARG_handle && obj == OBJ_qdisc && cmd == CMD_change)
476 ) {
476 NEXT_ARG(); 477 NEXT_ARG();
477 /* We don't care about duparg2("qdisc handle",*argv) for now */ 478 /* We don't care about duparg2("qdisc handle",*argv) for now */
478 if (get_qdisc_handle(&filter_qdisc, *argv)) 479 if (get_qdisc_handle(&filter_qdisc, *argv))
479 invarg(*argv, "qdisc"); 480 invarg(*argv, "qdisc");
480 } else if (obj != OBJ_qdisc && 481 } else
481 (arg == ARG_root 482 if (obj != OBJ_qdisc
482 || arg == ARG_parent 483 && (arg == ARG_root
483 || (obj == OBJ_filter && arg >= ARG_pref))) { 484 || arg == ARG_parent
485 || (obj == OBJ_filter && arg >= ARG_pref)
486 )
487 ) {
488 /* nothing */
484 } else { 489 } else {
485 invarg(*argv, "command"); 490 invarg(*argv, "command");
486 } 491 }
diff --git a/procps/pgrep.c b/procps/pgrep.c
index 3a717ecff..45de8bcda 100644
--- a/procps/pgrep.c
+++ b/procps/pgrep.c
@@ -129,9 +129,10 @@ int pgrep_main(int argc UNUSED_PARAM, char **argv)
129 continue; 129 continue;
130 130
131 /* NB: OPT_INVERT is always 0 or 1 */ 131 /* NB: OPT_INVERT is always 0 or 1 */
132 if (!argv[0] || 132 if (!argv[0]
133 (regexec(&re_buffer, cmd, 1, re_match, 0) == 0 /* match found */ 133 || (regexec(&re_buffer, cmd, 1, re_match, 0) == 0 /* match found */
134 && (!OPT_ANCHOR || (re_match[0].rm_so == 0 && re_match[0].rm_eo == (regoff_t)strlen(cmd)))) ^ OPT_INVERT 134 && (!OPT_ANCHOR || (re_match[0].rm_so == 0 && re_match[0].rm_eo == (regoff_t)strlen(cmd)))
135 ) ^ OPT_INVERT
135 ) { 136 ) {
136 matched_pid = proc->pid; 137 matched_pid = proc->pid;
137 if (OPT_LAST) { 138 if (OPT_LAST) {
diff --git a/shell/lash_unused.c b/shell/lash_unused.c
index 107ce88f6..513918962 100644
--- a/shell/lash_unused.c
+++ b/shell/lash_unused.c
@@ -950,8 +950,12 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
950 *buf++ = '\\'; 950 *buf++ = '\\';
951 *buf++ = '\\'; 951 *buf++ = '\\';
952 } 952 }
953 } else if (*src == '*' || *src == '?' || *src == '[' || 953 } else
954 *src == ']') *buf++ = '\\'; 954 if (*src == '*' || *src == '?'
955 || *src == '[' || *src == ']'
956 ) {
957 *buf++ = '\\';
958 }
955 *buf++ = *src; 959 *buf++ = *src;
956 } else if (isspace(*src)) { 960 } else if (isspace(*src)) {
957 if (*prog->argv[argc_l] || (flag & LASH_OPT_SAW_QUOTE)) { 961 if (*prog->argv[argc_l] || (flag & LASH_OPT_SAW_QUOTE)) {
@@ -1365,8 +1369,9 @@ static int busy_loop(FILE *input)
1365 continue; 1369 continue;
1366 } 1370 }
1367 1371
1368 if (!parse_command(&next_command, &newjob, &inbg) && 1372 if (!parse_command(&next_command, &newjob, &inbg)
1369 newjob.num_progs) { 1373 && newjob.num_progs
1374 ) {
1370 int pipefds[2] = { -1, -1 }; 1375 int pipefds[2] = { -1, -1 };
1371 debug_printf("job=%p fed to run_command by busy_loop()'\n", 1376 debug_printf("job=%p fed to run_command by busy_loop()'\n",
1372 &newjob); 1377 &newjob);
diff --git a/shell/msh_unused.c b/shell/msh_unused.c
index d4fe3db1b..54680226a 100644
--- a/shell/msh_unused.c
+++ b/shell/msh_unused.c
@@ -3873,9 +3873,10 @@ static char *blank(int f)
3873 scanequals = 0; 3873 scanequals = 0;
3874 for (;;) { 3874 for (;;) {
3875 c = subgetc('"', foundequals); 3875 c = subgetc('"', foundequals);
3876 if (c == 0 || 3876 if (c == 0
3877 f & (DOBLANK && any(c, ifs->value)) || 3877 || f & (DOBLANK && any(c, ifs->value))
3878 (!INSUB() && any(c, "\"'"))) { 3878 || (!INSUB() && any(c, "\"'"))
3879 ) {
3879 scanequals = 0; 3880 scanequals = 0;
3880 unget(c); 3881 unget(c);
3881 if (any(c, "\"'")) 3882 if (any(c, "\"'"))
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index 18ea05fec..feece9920 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -898,8 +898,12 @@ static void check_zones(unsigned i)
898 if (inode_count[i] > 1) /* have we counted this file already? */ 898 if (inode_count[i] > 1) /* have we counted this file already? */
899 return; 899 return;
900 inode = Inode1 + i; 900 inode = Inode1 + i;
901 if (!S_ISDIR(inode->i_mode) && !S_ISREG(inode->i_mode) && 901 if (!S_ISDIR(inode->i_mode)
902 !S_ISLNK(inode->i_mode)) return; 902 && !S_ISREG(inode->i_mode)
903 && !S_ISLNK(inode->i_mode)
904 ) {
905 return;
906 }
903 for (i = 0; i < 7; i++) 907 for (i = 0; i < 7; i++)
904 add_zone(i + inode->i_zone, &changed); 908 add_zone(i + inode->i_zone, &changed);
905 add_zone_ind(7 + inode->i_zone, &changed); 909 add_zone_ind(7 + inode->i_zone, &changed);
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 52ced7acd..23a345931 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -907,10 +907,12 @@ get_mountport(struct pmap *pm_mnt,
907 goto next; 907 goto next;
908 if (version && version <= 2 && pmap->pml_map.pm_vers > 2) 908 if (version && version <= 2 && pmap->pml_map.pm_vers > 2)
909 goto next; 909 goto next;
910 if (pmap->pml_map.pm_vers > MAX_NFSPROT || 910 if (pmap->pml_map.pm_vers > MAX_NFSPROT
911 (proto && pm_mnt->pm_prot && pmap->pml_map.pm_prot != proto) || 911 || (proto && pm_mnt->pm_prot && pmap->pml_map.pm_prot != proto)
912 (port && pmap->pml_map.pm_port != port)) 912 || (port && pmap->pml_map.pm_port != port)
913 ) {
913 goto next; 914 goto next;
915 }
914 memcpy(pm_mnt, &pmap->pml_map, sizeof(*pm_mnt)); 916 memcpy(pm_mnt, &pmap->pml_map, sizeof(*pm_mnt));
915 next: 917 next:
916 pmap = pmap->pml_next; 918 pmap = pmap->pml_next;
diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c
index 1f5ba2ecc..219654496 100644
--- a/util-linux/readprofile.c
+++ b/util-linux/readprofile.c
@@ -176,9 +176,11 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv)
176 /* ignore any LEADING (before a '[tT]' symbol is found) 176 /* ignore any LEADING (before a '[tT]' symbol is found)
177 Absolute symbols */ 177 Absolute symbols */
178 if ((*mode == 'A' || *mode == '?') && total == 0) continue; 178 if ((*mode == 'A' || *mode == '?') && total == 0) continue;
179 if (*mode != 'T' && *mode != 't' && 179 if (*mode != 'T' && *mode != 't'
180 *mode != 'W' && *mode != 'w') 180 && *mode != 'W' && *mode != 'w'
181 ) {
181 break; /* only text is profiled */ 182 break; /* only text is profiled */
183 }
182 184
183 if (indx >= len / sizeof(*buf)) 185 if (indx >= len / sizeof(*buf))
184 bb_error_msg_and_die("profile address out of range. " 186 bb_error_msg_and_die("profile address out of range. "
diff --git a/util-linux/volume_id/fat.c b/util-linux/volume_id/fat.c
index 6173ba9f0..b0f427c74 100644
--- a/util-linux/volume_id/fat.c
+++ b/util-linux/volume_id/fat.c
@@ -173,18 +173,22 @@ int FAST_FUNC volume_id_probe_vfat(struct volume_id *id /*,uint64_t fat_partitio
173 */ 173 */
174 174
175 /* boot jump address check */ 175 /* boot jump address check */
176 if ((vs->boot_jump[0] != 0xeb || vs->boot_jump[2] != 0x90) && 176 if ((vs->boot_jump[0] != 0xeb || vs->boot_jump[2] != 0x90)
177 vs->boot_jump[0] != 0xe9) 177 && vs->boot_jump[0] != 0xe9
178 ) {
178 return -1; 179 return -1;
180 }
179 181
180 /* heads check */ 182 /* heads check */
181 if (vs->heads == 0) 183 if (vs->heads == 0)
182 return -1; 184 return -1;
183 185
184 /* cluster size check */ 186 /* cluster size check */
185 if (vs->sectors_per_cluster == 0 || 187 if (vs->sectors_per_cluster == 0
186 (vs->sectors_per_cluster & (vs->sectors_per_cluster-1))) 188 || (vs->sectors_per_cluster & (vs->sectors_per_cluster-1))
189 ) {
187 return -1; 190 return -1;
191 }
188 192
189 /* media check */ 193 /* media check */
190 if (vs->media < 0xf8 && vs->media != 0xf0) 194 if (vs->media < 0xf8 && vs->media != 0xf0)
@@ -197,9 +201,11 @@ int FAST_FUNC volume_id_probe_vfat(struct volume_id *id /*,uint64_t fat_partitio
197 valid: 201 valid:
198 /* sector size check */ 202 /* sector size check */
199 sector_size_bytes = le16_to_cpu(vs->sector_size_bytes); 203 sector_size_bytes = le16_to_cpu(vs->sector_size_bytes);
200 if (sector_size_bytes != 0x200 && sector_size_bytes != 0x400 && 204 if (sector_size_bytes != 0x200 && sector_size_bytes != 0x400
201 sector_size_bytes != 0x800 && sector_size_bytes != 0x1000) 205 && sector_size_bytes != 0x800 && sector_size_bytes != 0x1000
206 ) {
202 return -1; 207 return -1;
208 }
203 209
204 dbg("sector_size_bytes 0x%x", sector_size_bytes); 210 dbg("sector_size_bytes 0x%x", sector_size_bytes);
205 dbg("sectors_per_cluster 0x%x", vs->sectors_per_cluster); 211 dbg("sectors_per_cluster 0x%x", vs->sectors_per_cluster);
diff --git a/util-linux/volume_id/unused_msdos.c b/util-linux/volume_id/unused_msdos.c
index ccec72c5e..65fb88501 100644
--- a/util-linux/volume_id/unused_msdos.c
+++ b/util-linux/volume_id/unused_msdos.c
@@ -73,9 +73,11 @@ int FAST_FUNC volume_id_probe_msdos_part_table(struct volume_id *id, uint64_t of
73 /* check flags on all entries for a valid partition table */ 73 /* check flags on all entries for a valid partition table */
74 part = (struct msdos_partition_entry*) &buf[MSDOS_PARTTABLE_OFFSET]; 74 part = (struct msdos_partition_entry*) &buf[MSDOS_PARTTABLE_OFFSET];
75 for (i = 0; i < 4; i++) { 75 for (i = 0; i < 4; i++) {
76 if (part[i].boot_ind != 0 && 76 if (part[i].boot_ind != 0
77 part[i].boot_ind != 0x80) 77 && part[i].boot_ind != 0x80
78 ) {
78 return -1; 79 return -1;
80 }
79 81
80 if (part[i].nr_sects != 0) 82 if (part[i].nr_sects != 0)
81 empty = 0; 83 empty = 0;