/* Get the rest directly from the pointer to the data. Of course, it's
* necessary to check there are really n bytes available. */
if (n > stream->data_bytes_left) {
- ERROR("Unexpected end of input when "
- "reading %zu bytes from bitstream "
- "(only have %u bytes left)\n", n,
- stream->data_bytes_left);
+ ERROR("Unexpected end of input when reading %zu bytes from "
+ "bitstream (only have %u bytes left)",
+ n, stream->data_bytes_left);
return 1;
}
memcpy(p, stream->data, n);
ret = bitstream_ensure_bits(stream, 16);
if (ret != 0) {
ERROR("Unexpected end of input when "
- "aligning bitstream!\n");
+ "aligning bitstream");
return ret;
}
}
* tree. */
if (decode_table_pos >= table_num_entries) {
ERROR("Huffman decoding table overrun: "
- "pos = %u, num_entries = %u\n",
- decode_table_pos,
- table_num_entries);
+ "pos = %u, num_entries = %u",
+ decode_table_pos, table_num_entries);
return 1;
}
uint i = current_code >> (code_len - num_bits);
if (i >= (1 << num_bits)) {
- ERROR("Invalid canonical Huffman code!\n");
+ ERROR("Invalid canonical Huffman code");
return 1;
}
for (uint i = 0; i < num_syms; i++) {
if (lens[i] != 0) {
- ERROR("Lengths do not form a valid "
- "canonical Huffman tree "
- "(only filled %u of %u decode "
- "table slots)!\n", decode_table_pos,
- table_num_entries);
+ ERROR("Lengths do not form a valid canonical "
+ "Huffman tree (only filled %u of %u "
+ "decode table slots)",
+ decode_table_pos, table_num_entries);
return 1;
}
}
bitstream_remove_bits(istream, key_size);
do {
if (bitsleft == 0) {
- ERROR("Input stream exhausted!\n");
+ ERROR("Input stream exhausted");
return 1;
}
key_bits = sym + bitstream_peek_bits(istream, 1);