summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2008-10-28 13:37:47 +0000
committerEzra Peisach <epeisach@mit.edu>2008-10-28 13:37:47 +0000
commitf1a29fa7b9b20d133af9fc0a40511b833dd2e14d (patch)
tree69890a2b9a8bb2ccbd14d3296defdf03141bca66 /src/util
parent6b2185530b56fc1230cb639016df40d44c7bb2e7 (diff)
downloadkrb5-f1a29fa7b9b20d133af9fc0a40511b833dd2e14d.tar.gz
krb5-f1a29fa7b9b20d133af9fc0a40511b833dd2e14d.tar.xz
krb5-f1a29fa7b9b20d133af9fc0a40511b833dd2e14d.zip
Unsigned/signed warnings cleanup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20928 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util')
-rw-r--r--src/util/profile/prof_get.c6
-rw-r--r--src/util/profile/prof_init.c12
2 files changed, 10 insertions, 8 deletions
diff --git a/src/util/profile/prof_get.c b/src/util/profile/prof_get.c
index 6426e15b96..6c94d96ccf 100644
--- a/src/util/profile/prof_get.c
+++ b/src/util/profile/prof_get.c
@@ -28,8 +28,8 @@
struct profile_string_list {
char **list;
- int num;
- int max;
+ unsigned int num;
+ unsigned int max;
};
/*
@@ -75,7 +75,7 @@ static void end_list(struct profile_string_list *list, char ***ret_list)
static errcode_t add_to_list(struct profile_string_list *list, const char *str)
{
char *newstr, **newlist;
- int newmax;
+ unsigned int newmax;
if (list->num+1 >= list->max) {
newmax = list->max + 10;
diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c
index 4048f88a9e..041ef747a0 100644
--- a/src/util/profile/prof_init.c
+++ b/src/util/profile/prof_init.c
@@ -71,7 +71,7 @@ profile_init(const_profile_filespec_t *files, profile_t *ret_profile)
#define COUNT_LINKED_LIST(COUNT, PTYPE, START, FIELD) \
{ \
- int cll_counter = 0; \
+ size_t cll_counter = 0; \
PTYPE cll_ptr = (START); \
while (cll_ptr != NULL) { \
cll_counter++; \
@@ -106,7 +106,8 @@ errcode_t KRB5_CALLCONV
profile_init_path(const_profile_filespec_list_t filepath,
profile_t *ret_profile)
{
- int n_entries, i;
+ unsigned int n_entries;
+ int i;
unsigned int ent_len;
const char *s, *t;
profile_filespec_t *filenames;
@@ -125,7 +126,7 @@ profile_init_path(const_profile_filespec_list_t filepath,
/* measure, copy, and skip each one */
for(s = filepath, i=0; (t = strchr(s, ':')) || (t=s+strlen(s)); s=t+1, i++) {
- ent_len = t-s;
+ ent_len = (unsigned int) (t-s);
filenames[i] = (char*) malloc(ent_len + 1);
if (filenames[i] == 0) {
/* if malloc fails, free the ones that worked */
@@ -344,6 +345,7 @@ errcode_t profile_ser_internalize(const char *unused, profile_t *profilep,
bp = *bufpp;
remain = *remainp;
+ fcount = 0;
if (remain >= 12)
(void) unpack_int32(&tmp, &bp, &remain);
@@ -358,11 +360,11 @@ errcode_t profile_ser_internalize(const char *unused, profile_t *profilep,
(void) unpack_int32(&fcount, &bp, &remain);
retval = ENOMEM;
- flist = (profile_filespec_t *) malloc(sizeof(profile_filespec_t) * (fcount + 1));
+ flist = (profile_filespec_t *) malloc(sizeof(profile_filespec_t) * (size_t) (fcount + 1));
if (!flist)
goto cleanup;
- memset(flist, 0, sizeof(char *) * (fcount+1));
+ memset(flist, 0, sizeof(char *) * (size_t) (fcount+1));
for (i=0; i<fcount; i++) {
if (!unpack_int32(&tmp, &bp, &remain)) {
flist[i] = (char *) malloc((size_t) (tmp+1));