Audit bb_common_bufsiz usage, add script which looks for misuse.

tr: stop using globals needlessly.
code: -103 bytes
This commit is contained in:
Denis Vlasenko
2007-06-04 10:16:52 +00:00
parent 4e5f82c76f
commit 74324c8666
21 changed files with 141 additions and 135 deletions

View File

@@ -9,9 +9,11 @@
#include "libbb.h"
#define searchString bb_common_bufsiz1
enum {
USERSIZE = sizeof(bb_common_bufsiz1) > 1024 ? 1024
: sizeof(bb_common_bufsiz1) - 1, /* max line length typed in by user */
USERSIZE = sizeof(searchString) > 1024 ? 1024
: sizeof(searchString) - 1, /* max line length typed in by user */
INITBUF_SIZE = 1024, /* initial buffer size */
};
@@ -22,8 +24,6 @@ typedef struct LINE {
char data[1];
} LINE;
#define searchString bb_common_bufsiz1
static LINE lines, *curLine;
static int curNum, lastNum, marks[26], dirty;
static char *bufBase, *bufPtr, *fileName;