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: nightquick <nightquick%proton.me@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, 05 Nov 2023 10:49:06 +0000

 > This is wrong, you need to compare the full string (or check for it
  being only a single char long).
 
 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()).
 
 > but I don't see the warning you are talking about
 
 Compiling with -Wconversion will emit the warning (for both GCC and Clang).
 



Home | Main Index | Thread Index | Old Index