From 374538ead7445e0cbfceedf6d3a864005c0ec388 Mon Sep 17 00:00:00 2001 From: Kenneth G Raeburn Date: Mon, 13 May 1991 09:22:19 +0000 Subject: increment counter while deleting a range of locations for dump_locs, use larger buffer, and static pointers initialized each time through the loop. --- server/uloc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'server/uloc.c') 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++ = '/'; -- cgit v1.2.3