From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45901 invoked by alias); 30 Oct 2019 10:44:09 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 45877 invoked by uid 89); 30 Oct 2019 10:44:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.suse.de From: Andreas Schwab To: "Florian Weimer \(Code Review\)" Cc: libc-alpha@sourceware.org, fweimer@redhat.com Subject: Re: [review] manual: Clarify strnlen, wcsnlen, strndup null termination behavior References: X-Yow: YOW!! Now I understand advanced MICROBIOLOGY and th' new TAX REFORM laws!! Date: Wed, 30 Oct 2019 10:44:00 -0000 In-Reply-To: (Florian Weimer's message of "Wed, 30 Oct 2019 06:25:15 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-10/txt/msg00911.txt.bz2 On Okt 30 2019, Florian Weimer (Code Review) wrote: > +Note that @var{s} must be an array of at least @var{maxlen} bytes. It > +is undefined to call @code{strnlen} on a shorter array, even if it is > +known that the shorter array contains a null terminator. This is not true. strnlen _always_ stops before the null byte. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."