Removed unnecessary buffer size constants

This commit is contained in:
Bert Münnich 2015-10-28 22:23:28 +01:00
parent 9a7e97cd89
commit b096cbd536
2 changed files with 3 additions and 14 deletions

9
main.c
View File

@ -42,11 +42,6 @@
#define _MAPPINGS_CONFIG #define _MAPPINGS_CONFIG
#include "config.h" #include "config.h"
enum {
FILENAME_CNT = 1024,
TITLE_LEN = 256
};
typedef struct { typedef struct {
const char *name; const char *name;
char *cmd; char *cmd;
@ -348,7 +343,7 @@ void bar_put(win_bar_t *bar, const char *fmt, ...)
void update_info(void) void update_info(void)
{ {
unsigned int i, fn, fw; unsigned int i, fn, fw;
char title[TITLE_LEN]; char title[256];
const char * mark; const char * mark;
bool ow_info; bool ow_info;
win_bar_t *l = &win.bar.l, *r = &win.bar.r; win_bar_t *l = &win.bar.l, *r = &win.bar.r;
@ -801,7 +796,7 @@ int main(int argc, char **argv)
} }
if (options->recursive || options->from_stdin) if (options->recursive || options->from_stdin)
filecnt = FILENAME_CNT; filecnt = 1024;
else else
filecnt = options->filecnt; filecnt = options->filecnt;

8
util.c
View File

@ -26,12 +26,6 @@
#include "options.h" #include "options.h"
#include "util.h" #include "util.h"
enum {
BUF_SIZE = 1024,
DNAME_CNT = 512,
FNAME_LEN = 1024
};
void cleanup(void); void cleanup(void);
void* s_malloc(size_t size) void* s_malloc(size_t size)
@ -117,7 +111,7 @@ int r_opendir(r_dir_t *rdir, const char *dirname)
return -1; return -1;
} }
rdir->stcap = DNAME_CNT; rdir->stcap = 512;
rdir->stack = (char**) s_malloc(rdir->stcap * sizeof(char*)); rdir->stack = (char**) s_malloc(rdir->stcap * sizeof(char*));
rdir->stlen = 0; rdir->stlen = 0;