- F5B3E5C736BE0C6C4E4FDCC50E2A436C17D3E84FE47E6125DD0FA775C9CFFCC625A98FE7091A036593E21CDAFA1E533FD8A04640649CD6ED89DA499C94333668
+ 6ED67D33234B4CC45910FC9D69C40C8DD7D205AEB7A5532EB83F5E889EA81556147B0D6689D46DF52B9C58F82C56A1A4B255BF7D09095BCFA170A27AE8203A93
vtools/src/context.c
(5 . 6)(5 . 18)
74 /* Print a label for a context diff, with a file name and date or a
75 label. */
76
77 const char bb_hexdigits_upcase[] = "0123456789ABCDEF";
78 char *bin2hex(char *p, const char *cp, int count) {
79 while (count) {
80 unsigned char c = *cp++;
81 /* put lowercase hex digits */
82 *p++ = 0x20 | bb_hexdigits_upcase[c >> 4];
83 *p++ = 0x20 | bb_hexdigits_upcase[c & 0xf];
84 count--;
85 }
86 return p;
87 }
88
89 static void
90 print_context_label(char const *mark,
91 struct file_data *inf,
(13 . 7)(25 . 13)
93 if (label)
94 fprintf(outfile, "%s %s\n", mark, label);
95 else {
96 fprintf(outfile, "%s %s false\n", mark, name);
97 if (inf->desc >= 0) {
98 char buf[(64 * 2) + 1] = {0};
99 bin2hex(buf, (char*) inf->hash, 64);
100 fprintf(outfile, "%s %s %s\n", mark, name, buf);
101 } else {
102 fprintf(outfile, "%s %s false\n", mark, name);
103 }
104 }
105 }
106