X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT delorie DOT com using -f From: DJ Delorie To: djgpp-workers AT delorie DOT com Cc: djgpp AT delorie DOT com Subject: Re: dxe3gen patch: replace memcmp with strncmp In-Reply-To: (djgpp-workers@delorie.com) Date: Tue, 16 May 2017 13:58:57 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > - if (memcmp(opt.excl_prefix[j], name, strlen(opt.excl_prefix[j])) == 0) > + if (strncmp(opt.excl_prefix[j], name, strlen(opt.excl_prefix[j])) == 0) If we're going to pass strlen() anyway, what is the down-side of just calling strcmp() ? Our strcmp() implementation never reads past the end of string anyway, should be safe, and faster.