term: error: update b_stringstream usage
This commit is contained in:
13
term/error.c
13
term/error.c
@@ -16,25 +16,24 @@ static void get_error_id(
|
||||
error_name = b_error_vendor_get_status_code_name(vendor, code);
|
||||
}
|
||||
|
||||
b_stringstream id;
|
||||
b_stringstream_begin(&id, out, max);
|
||||
b_stringstream *id = b_stringstream_create_with_buffer(out, max);
|
||||
|
||||
if (vendor_name) {
|
||||
b_stringstream_add(&id, vendor_name);
|
||||
b_stream_write_string(id, vendor_name, NULL);
|
||||
}
|
||||
|
||||
if (error_name) {
|
||||
if (vendor_name) {
|
||||
b_stringstream_add(&id, ".");
|
||||
b_stream_write_string(id, ".", NULL);
|
||||
}
|
||||
|
||||
b_stringstream_add(&id, error_name);
|
||||
b_stream_write_string(id, error_name, NULL);
|
||||
} else {
|
||||
if (vendor_name) {
|
||||
b_stringstream_add(&id, "#");
|
||||
b_stream_write_string(id, "#", NULL);
|
||||
}
|
||||
|
||||
b_stringstream_addf(&id, "%ld", code);
|
||||
b_stream_write_fmt(id, NULL, "%ld", code);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user