NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/57682: Check if suplied argument(s) has "-" using only argument vectors instead calling strcmp() function.



The following reply was made to PR bin/57682; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/57682: Check if suplied argument(s) has "-" using only
 argument vectors instead calling strcmp() function.
Date: Sun, 5 Nov 2023 12:34:20 +0100

 On Sun, Nov 05, 2023 at 10:50:01AM +0000, nightquick wrote:
 >  Shouldn't it then use strncmp() function instead? argv is inside a loop whe=
 >  re it's iterating over each character, and after testing it seems okay to m=
 >  e (without strcmp()).
 
 No, it is not - it is iterating over the argv[] strings which each are char*
 
 >  > but I don't see the warning you are talking about
 >  
 >  Compiling with -Wconversion will emit the warning (for both GCC and Clang).
 
 Yes, but we don't do that (and it is a harmless case).
 
 Martin
 


Home | Main Index | Thread Index | Old Index