summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorGravatar Kenneth G Raeburn <raeburn@mit.edu>1991-05-13 09:22:19 +0000
committerGravatar Kenneth G Raeburn <raeburn@mit.edu>1991-05-13 09:22:19 +0000
commit374538ead7445e0cbfceedf6d3a864005c0ec388 (patch)
treef52a2102baf8420a96a60bdabffdf19b49278be0 /server
parent57ae8cfe4d54ad3a9aa69c0e33b0c88b73f4c934 (diff)
increment counter while deleting a range of locations
for dump_locs, use larger buffer, and static pointers initialized each time through the loop.
Diffstat (limited to 'server')
-rw-r--r--server/uloc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/uloc.c b/server/uloc.c
index 72da7ea..4c33fba 100644
--- a/server/uloc.c
+++ b/server/uloc.c
@@ -1028,7 +1028,7 @@ ulogin_flush_user(ZNotice_t *notice)
/* skip over (and delete) matches */
j = i + num_match;
while (i < j)
- delete locations[i];
+ delete locations[i++];
/* copy the rest */
while (i < num_locs) {
@@ -1241,11 +1241,13 @@ void
uloc_dump_locs(register FILE *fp)
{
register int i;
- char buf[BUFSIZ], *bufp = buf;
- const char *cp;
+ char buf[BUFSIZ*3];
+ static char *bufp;
+ static const char *cp;
/* delay using stdio so that we can run FAST! */
for (i = 0; i < num_locs; i++) {
+ bufp = buf;
#define cpy(str) do{cp=(str);while(*cp){*bufp++=*cp++;}}while(0)
cpy (locations[i]->zlt_user.value ());
*bufp++ = '/';