#include <afs/param.h>
#include <roken.h>
+#include <afs/opr.h>
#include <ctype.h>
#include <math.h>
}
}
range = abs(startId - maxId);
- if (range < 0)
- range = -range;
range++; /* number that can be printed */
if (range < number) {
fprintf(stderr, "Only %d ids to be checked.\n", range);
printf("Checking for %d %sused ids starting at %d.\n", number,
(unused ? "un" : ""), startId);
#define NUM 100
- lids.idlist_val = (afs_int32 *) malloc(sizeof(afs_int32) * NUM);
+ lids.idlist_val = malloc(sizeof(afs_int32) * NUM);
lnames.namelist_len = 0;
lnames.namelist_val = 0;
while (number) {
srandom(seed);
- users = (afs_int32 *) malloc(number * sizeof(afs_int32));
- groups = (afs_int32 *) malloc(number * sizeof(afs_int32));
- filled = (char *)malloc(number * sizeof(char));
- cleaned = (char *)malloc(number * sizeof(char));
- population = (char *)malloc(sqr(number) * sizeof(char));
+ users = calloc(number, sizeof(afs_int32));
+ groups = calloc(number, sizeof(afs_int32));
+ filled = calloc(number, sizeof(char));
+ cleaned = calloc(number, sizeof(char));
+ population = calloc(sqr(number), sizeof(char));
nFilled = 0;
- memset(filled, 0, number);
nCleaned = 0;
- memset(cleaned, 0, number);
- memset(population, 0, sqr(number));
- memset(users, 0, number * sizeof(afs_int32));
- memset(groups, 0, number * sizeof(afs_int32));
ownerUser = lastGroup = 0;
- groupOwners = (afs_int32 *) malloc(number * sizeof(afs_int32));
+ groupOwners = malloc(number * sizeof(afs_int32));
nUsers = nGroups = nAdds = nRems = nUDels = nGDels = 0;
while ((nFilled < number) || (nCleaned < number)) {
/* check the membership list of all users for correctness */
printf("Starting check of memberships\n");
- glist = (afs_int32 *) malloc(number * sizeof(afs_int32));
+ glist = malloc(number * sizeof(afs_int32));
for (u = 0; u < number; u++) {
afs_int32 ui = users[u];
if (ui) {
}
strcompose(tmp_conf_file, 128, tmp_conf_dir, "/",
- AFSDIR_CELLSERVDB_FILE, NULL);
+ AFSDIR_CELLSERVDB_FILE, (char *)NULL);
f = fopen(tmp_conf_file, "w");
if (f == 0) {
cantcreate:
}
strcompose(tmp_cell_file, 128, tmp_conf_dir, "/",
- AFSDIR_THISCELL_FILE, NULL);
+ AFSDIR_THISCELL_FILE, (char *)NULL);
f = fopen(tmp_cell_file, "w");
if (f == 0)
goto cantcreate;
goto cantclose;
strcompose(tmp_noauth_file, 128, tmp_conf_dir, "/",
- AFSDIR_NOAUTH_FILE, NULL);
+ AFSDIR_NOAUTH_FILE, (char *)NULL);
if (noAuth) {
code = creat(tmp_noauth_file, 0777);
if (code && (errno != EEXIST))