Audit bb_common_bufsiz usage, add script which looks for misuse.
tr: stop using globals needlessly. code: -103 bytes
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user