]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Fix error reporting of fwp_fna functions
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 13 Aug 2009 11:02:03 +0000 (13:02 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 13 Aug 2009 11:02:03 +0000 (13:02 +0200)
Return value of several functions was stored in a variable of unsigned
type size_t and later was checked to be less then zero, which was always
true. Now, we use signed type ssize_t for this cases.

fwp/lib/frsh_fwp/fwp_fna.c

index 2cd477a909842751fa3a6262c27b5fdee886fdf2..978c0cee4704953efcc7eb29939146fc71690d86 100644 (file)
@@ -167,7 +167,7 @@ int fwp_fna_receive(const fna_endpoint_data_t *endpoint,
                        size_t *received_bytes, frsh_network_address_t *from)
 {
        unsigned int from_addr;
-       size_t len;
+       ssize_t len;
        fwp_endpoint_t *fwp_epoint;
        int flags = 0;
        
@@ -187,7 +187,7 @@ int fwp_fna_receive_sync(const fna_endpoint_data_t *endpoint, void *buffer,
                         frsh_network_address_t *from)
 {
        unsigned int from_addr;
-       size_t len;
+       ssize_t len;
        fwp_endpoint_t *fwp_epoint;
        int flags = 0;
        
@@ -209,7 +209,7 @@ int fwp_fna_receive_async(const fna_endpoint_data_t *endpoint, void *buffer,
                         frsh_network_address_t *from)
 {
        unsigned int from_addr;
-       size_t len;
+       ssize_t len;
        fwp_endpoint_t *fwp_epoint;
        int flags = 0;