/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#include <afsconfig.h>
#include <afs/param.h>
-#include <string.h>
-#include <errno.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
+#include <roken.h>
#include "afsutil.h"
afs_int32
volutil_GetPartitionID(char *aname)
{
- register char tc;
+ char tc;
afs_int32 temp;
char ascii[3];
if (strlen(aname) <= 2) {
strcpy(ascii, aname);
} else if (!strncmp(aname, "/vicep", 6)) {
- strncpy(ascii, aname + 6, 2);
+ if(strlcpy(ascii, aname + 6, sizeof(ascii)) >= sizeof(ascii))
+ return -1; /* bad partition name: trailing characters */
} else if (!strncmp(aname, "vicep", 5)) {
- strncpy(ascii, aname + 5, 2);
+ if(strlcpy(ascii, aname + 5, sizeof(ascii)) >= sizeof(ascii))
+ return -1; /* bad partition name: trailing characters */
} else
return -1; /* bad partition name */
/* now partitions are named /vicepa ... /vicepz, /vicepaa, /vicepab, .../vicepzz,
volutil_PartitionName2_r(afs_int32 part, char *tbuffer, size_t buflen)
{
char tempString[3];
- register int i;
+ int i;
if (part < 0 || part >= VOLMAXPARTS) {
return -2;
/* is this a digit or a digit-like thing? */
static int
-ismeta(register int ac, register int abase)
+ismeta(int ac, int abase)
{
/* if (ac == '-' || ac == 'x' || ac == 'X') return 1; */
if (ac >= '0' && ac <= '7')
/* given that this is a digit or a digit-like thing, compute its value */
static int
-getmeta(register int ac)
+getmeta(int ac)
{
if (ac >= '0' && ac <= '9')
return ac - '0';
}
afs_int32
-util_GetInt32(register char *as, afs_int32 * aval)
+util_GetInt32(char *as, afs_int32 * aval)
{
- register afs_int32 total;
- register int tc;
+ afs_int32 total;
+ int tc;
int base;
int negative;
}
afs_uint32
-util_GetUInt32(register char *as, afs_uint32 * aval)
+util_GetUInt32(char *as, afs_uint32 * aval)
{
- register afs_uint32 total;
- register int tc;
+ afs_uint32 total;
+ int tc;
int base;
total = 0; /* initialize things */
};
afs_int32
-util_GetHumanInt32(register char *as, afs_int32 * aval)
+util_GetHumanInt32(char *as, afs_int32 * aval)
{
long value;
char * unit;