Don't cast the return from realloc()
[openafs.git] / src / vlserver / vlprocs.c
index b117ee4..c053329 100644 (file)
@@ -601,7 +601,7 @@ GetEntryByName(struct rx_call *rxcall,
     char rxstr[AFS_RXINFO_LEN];
 
     if (NameIsId(volname)) {
-       return GetEntryByID(rxcall, atoi(volname), -1, aentry, new, this_op);
+       return GetEntryByID(rxcall, strtoul(volname, NULL, 10), -1, aentry, new, this_op);
     }
     if (InvalidVolname(volname))
        return VL_BADNAME;
@@ -683,7 +683,7 @@ SVL_GetNewVolumeId(struct rx_call *rxcall, afs_uint32 Maxvolidbump,
     if (!afsconf_SuperUser(vldb_confdir, rxcall, NULL))
        END(VL_PERM);
 
-    if (Maxvolidbump < 0 || Maxvolidbump > MAXBUMPCOUNT)
+    if (Maxvolidbump > MAXBUMPCOUNT)
        END(VL_BADVOLIDBUMP);
 
     if ((code = Init_VLdbase(&ctx, LOCKWRITE, this_op)))
@@ -1348,9 +1348,8 @@ SVL_ListAttributes(struct rx_call *rxcall,
        && (allocCount > vldbentries->bulkentries_len)) {
 
        vldbentries->bulkentries_val =
-           (vldbentry *) realloc(vldbentries->bulkentries_val,
-                                 vldbentries->bulkentries_len *
-                                 sizeof(vldbentry));
+           realloc(vldbentries->bulkentries_val,
+                   vldbentries->bulkentries_len * sizeof(vldbentry));
        if (vldbentries->bulkentries_val == NULL) {
            code = VL_NOMEM;
            goto abort;
@@ -1480,9 +1479,8 @@ SVL_ListAttributesN(struct rx_call *rxcall,
        && (allocCount > vldbentries->nbulkentries_len)) {
 
        vldbentries->nbulkentries_val =
-           (nvldbentry *) realloc(vldbentries->nbulkentries_val,
-                                  vldbentries->nbulkentries_len *
-                                  sizeof(nvldbentry));
+           realloc(vldbentries->nbulkentries_val,
+                   vldbentries->nbulkentries_len * sizeof(nvldbentry));
        if (vldbentries->nbulkentries_val == NULL) {
            code = VL_NOMEM;
            goto abort;
@@ -1760,7 +1758,7 @@ SVL_ListAttributesN2(struct rx_call *rxcall,
        countAbort(this_op);
        ubik_AbortTrans(ctx.trans);
        if (vldbentries->nbulkentries_val)
-           free((char *)vldbentries->nbulkentries_val);
+           free(vldbentries->nbulkentries_val);
        vldbentries->nbulkentries_val = 0;
        vldbentries->nbulkentries_len = 0;
        *nextstartindex = -1;
@@ -2664,9 +2662,8 @@ put_attributeentry(struct vl_ctx *ctx,
         * then grow in increments of VLDBALLOCINCR.
         */
        allo = (*alloccnt > VLDBALLOCLIMIT) ? VLDBALLOCINCR : *alloccnt;
-       reall =
-           (vldbentry *) realloc(*VldbentryFirst,
-                                 (*alloccnt + allo) * sizeof(vldbentry));
+       reall = realloc(*VldbentryFirst,
+                       (*alloccnt + allo) * sizeof(vldbentry));
        if (reall == NULL)
            return VL_NOMEM;
 
@@ -2711,9 +2708,8 @@ put_nattributeentry(struct vl_ctx *ctx,
         * then grow in increments of VLDBALLOCINCR.
         */
        allo = (*alloccnt > VLDBALLOCLIMIT) ? VLDBALLOCINCR : *alloccnt;
-       reall =
-           (nvldbentry *) realloc(*VldbentryFirst,
-                                  (*alloccnt + allo) * sizeof(nvldbentry));
+       reall = realloc(*VldbentryFirst,
+                       (*alloccnt + allo) * sizeof(nvldbentry));
        if (reall == NULL)
            return VL_NOMEM;
 
@@ -3204,7 +3200,7 @@ vlentry_to_uvldbentry(struct vl_ctx *ctx, struct nvlentry *VlEntry,
 
            tuuid = exp->ex_hostuuid;
            afs_ntohuuid(&tuuid);
-           VldbEntry->serverFlags[i] |= VLSERVER_FLAG_UUID;
+           VldbEntry->serverFlags[i] |= VLSF_UUID;
            VldbEntry->serverNumber[i] = tuuid;
            VldbEntry->serverUnique[i] = ntohl(exp->ex_uniquifier);
        } else {