This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] iconv_prog: Don't slurp whole input at once [BZ #6050]
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Benjamin Herr <ben at 0x539 dot de>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 10 Aug 2015 00:31:43 +0200
- Subject: Re: [PATCH 1/2] iconv_prog: Don't slurp whole input at once [BZ #6050]
- Authentication-results: sourceware.org; auth=none
- References: <1439158464-18443-1-git-send-email-ben at 0x539 dot de> <1439158464-18443-2-git-send-email-ben at 0x539 dot de>
Benjamin Herr <ben@0x539.de> writes:
> +static int
s/int/size_t/
> +saturating_add (size_t a, size_t b)
> +{
> + if ((size_t) -1 - a > b)
> + return a + b;
> + else
> + return -1;
> +}
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."