diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-01-29 17:32:08 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-01-29 17:32:30 +0100 |
commit | bbbb1adae92d53840ef28ec955a388d2d2bf7c0a (patch) | |
tree | 72adbdafd28c2741015685a65c3c2ec08a337289 /common | |
parent | 97b1491ba3c93fa7d44b22f72e2be1eae6c96496 (diff) |
Fix signed/unsigned integer comparison for helpers
Diffstat (limited to 'common')
-rw-r--r-- | common/glib-helper.c | 2 | ||||
-rw-r--r-- | common/sdp-xml.c | 3 | ||||
-rw-r--r-- | common/test_textfile.c | 3 | ||||
-rw-r--r-- | common/textfile.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/common/glib-helper.c b/common/glib-helper.c index f66d8f52..9e1f6f3f 100644 --- a/common/glib-helper.c +++ b/common/glib-helper.c @@ -227,7 +227,7 @@ static void search_completed_cb(uint8_t type, uint16_t status, bytesleft -= recsize; recs = sdp_list_append(recs, rec); - } while (scanned < size && bytesleft > 0); + } while (scanned < (ssize_t) size && bytesleft > 0); done: cache_sdp_session(&ctxt->src, &ctxt->dst, ctxt->session); diff --git a/common/sdp-xml.c b/common/sdp-xml.c index 385e9019..0403dcdd 100644 --- a/common/sdp-xml.c +++ b/common/sdp-xml.c @@ -411,8 +411,7 @@ void convert_sdp_record_to_xml(sdp_record_t *rec, static sdp_data_t *sdp_xml_parse_uuid128(const char *data) { uint128_t val; - int i; - int j; + unsigned int i, j; char buf[3]; diff --git a/common/test_textfile.c b/common/test_textfile.c index 7d48fa4e..29ca493c 100644 --- a/common/test_textfile.c +++ b/common/test_textfile.c @@ -43,7 +43,8 @@ int main(int argc, char *argv[]) { char filename[] = "/tmp/textfile"; char key[18], value[512], *str; - int i, j, fd, err, size, max = 10; + unsigned int i, j, size, max = 10; + int fd, err; size = getpagesize(); printf("System uses a page size of %d bytes\n\n", size); diff --git a/common/textfile.c b/common/textfile.c index d1df7ef1..eaf77568 100644 --- a/common/textfile.c +++ b/common/textfile.c @@ -213,7 +213,7 @@ static int write_key(const char *pathname, const char *key, const char *value, i goto unmap; } - if (value && (strlen(value) == end - off - len - 1) && + if (value && ((ssize_t) strlen(value) == end - off - len - 1) && !strncmp(off + len + 1, value, end - off - len - 1)) goto unmap; |