diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-01-25 23:49:09 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-01-25 23:49:09 +0000 |
commit | d35c21587a4139031c077fd122252217a4713681 (patch) | |
tree | 7bd14fd247492c00f3d38ae1dbd7727e03fda9ad /tr.c | |
parent | ffde8673fe8b2c32076aa3e01eab1fefc5f08e86 (diff) | |
download | busybox-w32-d35c21587a4139031c077fd122252217a4713681.tar.gz busybox-w32-d35c21587a4139031c077fd122252217a4713681.tar.bz2 busybox-w32-d35c21587a4139031c077fd122252217a4713681.zip |
Commit Larry Doolittle's buffers-on-stack/buffers-via-malloc patch.
-Erik
Diffstat (limited to 'tr.c')
-rw-r--r-- | tr.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -144,10 +144,11 @@ extern int tr_main(int argc, char **argv) | |||
144 | int output_length=0, input_length; | 144 | int output_length=0, input_length; |
145 | int index = 1; | 145 | int index = 1; |
146 | int i; | 146 | int i; |
147 | /* set up big arrays here (better than making a bunch of static arrays up top) */ | 147 | RESERVE_BB_BUFFER(output, BUFSIZ); |
148 | unsigned char output[BUFSIZ], input[BUFSIZ]; | 148 | RESERVE_BB_BUFFER(input, BUFSIZ); |
149 | unsigned char vector[ASCII + 1]; | 149 | RESERVE_BB_UBUFFER(vector, ASCII+1); |
150 | char invec[ASCII + 1], outvec[ASCII + 1]; | 150 | RESERVE_BB_BUFFER(invec, ASCII+1); |
151 | RESERVE_BB_BUFFER(outvec, ASCII+1); | ||
151 | 152 | ||
152 | /* ... but make them available globally */ | 153 | /* ... but make them available globally */ |
153 | poutput = output; | 154 | poutput = output; |