MCPcopy Create free account
hub / github.com/coreutils/coreutils / print_stored

Function print_stored

src/pr.c:2574–2632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2572 Return true, meaning there is no need to call read_rest_of_line. */
2573
2574static bool
2575print_stored (COLUMN *p)
2576{
2577 COLUMN *q;
2578
2579 int line = p->current_line++;
2580 char *first = &buff[line_vector[line]];
2581 /* FIXME
2582 UMR: Uninitialized memory read:
2583 * This is occurring while in:
2584 print_stored [pr.c:2239]
2585 * Reading 4 bytes from 0x5148c in the heap.
2586 * Address 0x5148c is 4 bytes into a malloc'd block at 0x51488 of 676 bytes
2587 * This block was allocated from:
2588 malloc [rtlib.o]
2589 xmalloc [xmalloc.c:94]
2590 init_store_cols [pr.c:1648]
2591 */
2592 char *last = &buff[line_vector[line + 1]];
2593
2594 pad_vertically = true;
2595
2596 if (print_a_header)
2597 print_header ();
2598
2599 if (p->status == FF_FOUND)
2600 {
2601 int i;
2602 for (i = 1, q = column_vector; i <= columns; ++i, ++q)
2603 q->status = ON_HOLD;
2604 if (column_vector->lines_to_print <= 0)
2605 {
2606 if (!extremities)
2607 pad_vertically = false;
2608 return true; /* print a header only */
2609 }
2610 }
2611
2612 if (col_sep_length < padding_not_printed)
2613 {
2614 pad_across_to (padding_not_printed - col_sep_length);
2615 padding_not_printed = ANYWHERE;
2616 }
2617
2618 if (use_col_separator)
2619 print_sep_string ();
2620
2621 while (first != last)
2622 print_char (*first++);
2623
2624 if (spaces_not_printed == 0)
2625 {
2626 output_position = p->start_position + end_vector[line];
2627 if (p->start_position - col_sep_length == chars_per_margin)
2628 output_position -= col_sep_length;
2629 }
2630
2631 return true;

Callers

nothing calls this directly

Calls 4

print_headerFunction · 0.85
pad_across_toFunction · 0.85
print_sep_stringFunction · 0.85
print_charFunction · 0.85

Tested by

no test coverage detected