[PATCH] dosfs: Unsigned compared against 0

Gedare Bloom gedare at rtems.org
Thu Sep 5 17:18:10 UTC 2013


On Thu, Sep 5, 2013 at 1:17 PM, Gedare Bloom <gedare at rtems.org> wrote:
> Change the type for storing the return from iconv to be signed.
> ---
>  cpukit/libfs/src/dosfs/msdos_conv_utf8.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/cpukit/libfs/src/dosfs/msdos_conv_utf8.c b/cpukit/libfs/src/dosfs/msdos_conv_utf8.c
> index a80db7e..18aebc6 100644
> --- a/cpukit/libfs/src/dosfs/msdos_conv_utf8.c
> +++ b/cpukit/libfs/src/dosfs/msdos_conv_utf8.c
> @@ -57,7 +57,7 @@ static int msdos_utf8_convert_with_iconv(
>    size_t  outbytes_left = *dst_size;
>    char   *inbuf = (void *) (uintptr_t) src;
>    char   *outbuf = dst;
> -  size_t  iconv_status;
> +  ssize_t iconv_status;
>
>    iconv_status = iconv(
Note that iconv returns a size_t. Perhaps the return value should be
cast explicitly to make this clear. newlib returns (size_t)-1 in case
of an error in iconv.

>      desc,
> --
> 1.7.1
>



More information about the devel mailing list