In your code, argv[1] == "-s" is the erroneous part. string comparisons cannot be performed using the == operator.
To compare strings, you need to use strcmp() .
Your code should look like
if ( ! strcmp(argv[1], "-s")) {
if you want to check if argv[1] contains "-s" or not.
source share