From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13346 invoked by alias); 29 Feb 2008 00:37:46 -0000 Received: (qmail 13270 invoked by uid 48); 29 Feb 2008 00:37:02 -0000 Date: Fri, 29 Feb 2008 00:37:00 -0000 From: "egmont at gmail dot com" To: glibc-bugs@sources.redhat.com Message-ID: <20080229003702.5806.egmont@gmail.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/5806] New: wrong comment in strlen() and other functions X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00123.txt.bz2 strlen() and similar functions use some cool magic to determine whether any bytes of an integer is zero. This magic is explained in a long comment in all these source files. Part of this comment is: 1) Is this safe? Will it catch all the zero bytes? Suppose there is a byte with all zeros. Any carry bits propagating from its left will fall into the hole at its least significant bit and stop. [...] "propagating from its left" is wrong, it should be "propagating from its right". In glibc-2.7 there are 14 files that contain this typo. Luckily the wording and the formatting of the paragraph is exactly the same everywhere. I don't send a patch because that might easily get outdated or miss some newly added files. Rather, please do a combo of grep and sed or whatever similar tools to fix these. -- Summary: wrong comment in strlen() and other functions Product: glibc Version: unspecified Status: NEW Severity: minor Priority: P3 Component: libc AssignedTo: drepper at redhat dot com ReportedBy: egmont at gmail dot com CC: glibc-bugs at sources dot redhat dot com http://sourceware.org/bugzilla/show_bug.cgi?id=5806 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.