Committer: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx> Date: 30/05/2010 at 23:06:56 Revision: 4639 Revision-id: mircea.gherzan@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Branch nick: trunk Log: lib: core: fix more signedness issues. Modified: M lib/core/straddr.c M lib/core/transform.c === modified file 'lib/core/straddr.c' --- lib/core/straddr.c 2010-05-22 12:37:40 +0000 +++ lib/core/straddr.c 2010-05-30 20:06:25 +0000 @@ -106,13 +106,13 @@ */ int hip_string_to_lowercase(char *to, const char *from, const size_t count) { + unsigned i; + if (to == NULL || from == NULL || count == 0) { return -1; } - int i = 0; - - for (; i < count; i++) { + for (i = 0; i < count; i++) { if (isalpha(from[i])) { to[i] = tolower(from[i]); } else { === modified file 'lib/core/transform.c' --- lib/core/transform.c 2010-03-09 16:09:38 +0000 +++ lib/core/transform.c 2010-05-30 20:06:25 +0000 @@ -74,15 +74,13 @@ hip_transform_suite_t hip_select_esp_transform(struct hip_esp_transform *ht) { hip_transform_suite_t tid = 0; - int i; - int length; + unsigned i, length; hip_transform_suite_t *suggestion; length = hip_get_param_contents_len(ht); suggestion = (uint16_t *) &ht->suite_id[0]; - if (length > sizeof(struct hip_esp_transform) - - sizeof(struct hip_common)) { + if (length > sizeof(struct hip_esp_transform) - sizeof(struct hip_common)) { HIP_ERROR("Too many transforms\n"); goto out; }