static char *pinvec, *poutvec;
-static void convert()
+static void convert(void)
{
short read_chars = 0;
short c, coded;
if (in_index == read_chars) {
if ((read_chars = read(0, (char *) pinput, BUFSIZ)) <= 0) {
if (write(1, (char *) poutput, out_index) != out_index)
- error_msg("%s", write_error);
+ bb_error_msg(bb_msg_write_error);
exit(0);
}
in_index = 0;
poutput[out_index++] = last = coded;
if (out_index == BUFSIZ) {
if (write(1, (char *) poutput, out_index) != out_index)
- error_msg_and_die("%s", write_error);
+ bb_error_msg_and_die(bb_msg_write_error);
out_index = 0;
}
}
while (*arg) {
if (*arg == '\\') {
arg++;
- *buffer++ = process_escape_sequence(&arg);
+ *buffer++ = bb_process_escape_sequence(&arg);
} else if (*(arg+1) == '-') {
ac = *(arg+2);
if(ac == 0) {
int output_length=0, input_length;
int idx = 1;
int i;
- RESERVE_BB_BUFFER(output, BUFSIZ);
- RESERVE_BB_BUFFER(input, BUFSIZ);
- RESERVE_BB_UBUFFER(vector, ASCII+1);
- RESERVE_BB_BUFFER(invec, ASCII+1);
- RESERVE_BB_BUFFER(outvec, ASCII+1);
+ RESERVE_CONFIG_BUFFER(output, BUFSIZ);
+ RESERVE_CONFIG_BUFFER(input, BUFSIZ);
+ RESERVE_CONFIG_UBUFFER(vector, ASCII+1);
+ RESERVE_CONFIG_BUFFER(invec, ASCII+1);
+ RESERVE_CONFIG_BUFFER(outvec, ASCII+1);
/* ... but make them available globally */
poutput = output;
sq_fl = TRUE;
break;
default:
- show_usage();
+ bb_show_usage();
}
}
idx++;
input_length = complement(input, input_length);
if (argv[idx] != NULL) {
if (*argv[idx] == '\0')
- error_msg_and_die("STRING2 cannot be empty");
+ bb_error_msg_and_die("STRING2 cannot be empty");
output_length = expand(argv[idx], output);
map(input, input_length, output, output_length);
}