if (argc == 3) {
if (strcmp(argv[1], "-i") == 0) initpass(argv[2]);
- else if (strcmp(argv[1], "-s") == 0) printf("%s\n", showpass(argv[2]));
+ else if (strcmp(argv[1], "-s") == 0) {
+ const char *pass = showpass(argv[2]);
+ if (pass == NULL) return -1;
+ printf("%s\n", pass);
+ }
else if (strcmp(argv[1], "-y") == 0) yankpass(argv[2]);
else if (strcmp(argv[1], "-a") == 0) addpass(argv[2]);
else if (strcmp(argv[1], "-d") == 0) delpass(argv[2], 0);
if (gpgfile == NULL) {
if (strncmp(lang, "en", 2) == 0) {
perror("Failed to opening file");
- fprintf(stderr, "Failing path: %s\n", gpgpath);
} else {
perror("ファイルを開くに失敗");
- fprintf(stderr, "失敗したパス: %s\n", gpgpath);
}
free(gpgpath);
return NULL;