help-gnutls
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gnutls] Re: Recognising error codes with an unsigned size_t


From: Michael Weiser
Subject: [Help-gnutls] Re: Recognising error codes with an unsigned size_t
Date: Thu, 13 Nov 2008 21:00:22 +0100
User-agent: Mutt/1.5.16 (2007-06-09)

On Thu, Nov 13, 2008 at 09:33:48AM +0100, Simon Josefsson wrote:

> > I'm writing a small program using gnutls and its gnutls_record_{recv,send}()
> > interface. They return a size_t which holds either the number of bytes
> > transferred or a negative error code.
> No, they return a ssize_t.

> > seems just as wrong to me. Am I missing the obvious here?
> I think you are using the wrong type for the 'bytes' variable, use
> 'ssize_t' which is guaranteed to be signed.  Then the '< 0' comparison
> should work.

Cheers. That was the obvious I was missing. With ssize_t's it works
nicely now.
-- 
Michael




reply via email to

[Prev in Thread] Current Thread [Next in Thread]