diff options
author | Jeremy Allison <jra@samba.org> | 2000-01-04 19:19:07 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-01-04 19:19:07 +0000 |
commit | 8515bdb39c603864246d3a4ff2349fa76b0bd86e (patch) | |
tree | b763f169412de2ffed56a5a2947cd6c30de1fa08 /source/param | |
parent | 70d6f7635776bba98c9c09405eff6c2087dac590 (diff) | |
download | samba-8515bdb39c603864246d3a4ff2349fa76b0bd86e.tar.gz samba-8515bdb39c603864246d3a4ff2349fa76b0bd86e.tar.xz samba-8515bdb39c603864246d3a4ff2349fa76b0bd86e.zip |
Added "crap" fix for rotating string buffers. (Increased to 20, added #define).
Andrew - please fix this properly when you have time :-).
Jeremy.
Diffstat (limited to 'source/param')
-rw-r--r-- | source/param/loadparm.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/param/loadparm.c b/source/param/loadparm.c index e24877e1241..6d825541302 100644 --- a/source/param/loadparm.c +++ b/source/param/loadparm.c @@ -1090,6 +1090,7 @@ static void init_locals(void) } } +#define NUMBER_OF_STATIC_STRING_BUFS 20 /******************************************************************* a convenience routine to grab string parameters into a rotating buffer, @@ -1098,8 +1099,8 @@ callers without affecting the source string. ********************************************************************/ static char *lp_string(const char *s) { - static char *bufs[10]; - static size_t buflen[10]; + static char *bufs[NUMBER_OF_STATIC_STRING_BUFS]; + static size_t buflen[NUMBER_OF_STATIC_STRING_BUFS]; static int next = -1; char *ret; int i; @@ -1107,7 +1108,7 @@ static char *lp_string(const char *s) if (next == -1) { /* initialisation */ - for (i=0;i<10;i++) { + for (i=0;i<NUMBER_OF_STATIC_STRING_BUFS;i++) { bufs[i] = NULL; buflen[i] = 0; } @@ -1129,7 +1130,7 @@ static char *lp_string(const char *s) } ret = &bufs[next][0]; - next = (next+1)%10; + next = (next+1)%NUMBER_OF_STATIC_STRING_BUFS; if (!s) *ret = 0; |