uppercase characters in a string cannot be converted to lowercase and substracting their ASCII value doesnt make them in alphabetical index : I am a beginner trying to learn to code.
Currently I am doing CS50 course, I have encountered a problem with a Vigenere cipher problem, please see my code on a github link below.

[github gist][1] - https://gist.github.com/adamstraka/dc2356d411aeae129f9a7ecc522cc274

The issues are as following:
1.] if you pass an argument in upercase letters in a key, the values are weird and the conversion doesnt work, the idea is to take each character in a string key and substracting 65 if uppercase, or 97 if lowercase, so their ASCII value would go to 0 - 26. I then can make a use of them in a Vigenere cipher formula: cipher[i index] = (plaintext[i index] + key[j index]) % 26

2.] doesnt handle lack of argv[1], even though there is an IF condition (!argc == 2), so it shouldt go trough if you doesnt pass anything.
    "failed to execute program due to segmentation fault".

I have tried everything in my capability, I am pretty tired, maybe tomorrow the solution will popuout instantly.
I ask you to give me some hints, possibly not revealing everything, but maybe guiding me, so I can learn from it.
Thank you!


  [1]: https://gist.github.com/adamstraka/dc2356d411aeae129f9a7ecc522cc274