このコミットが含まれているのは:
守矢諏訪子 2024-05-22 10:35:22 +09:00
コミット cf7147a90f
2個のファイルの変更5行の追加3行の削除

6
main.c
ファイルの表示

@ -78,7 +78,11 @@ int main(int argc, char *argv[]) {
if (argc == 3) { if (argc == 3) {
if (strcmp(argv[1], "-i") == 0) initpass(argv[2]); 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], "-y") == 0) yankpass(argv[2]);
else if (strcmp(argv[1], "-a") == 0) addpass(argv[2]); else if (strcmp(argv[1], "-a") == 0) addpass(argv[2]);
else if (strcmp(argv[1], "-d") == 0) delpass(argv[2], 0); else if (strcmp(argv[1], "-d") == 0) delpass(argv[2], 0);

ファイルの表示

@ -68,10 +68,8 @@ const char *showpass(char *file) {
if (gpgfile == NULL) { if (gpgfile == NULL) {
if (strncmp(lang, "en", 2) == 0) { if (strncmp(lang, "en", 2) == 0) {
perror("Failed to opening file"); perror("Failed to opening file");
fprintf(stderr, "Failing path: %s\n", gpgpath);
} else { } else {
perror("ファイルを開くに失敗"); perror("ファイルを開くに失敗");
fprintf(stderr, "失敗したパス: %s\n", gpgpath);
} }
free(gpgpath); free(gpgpath);
return NULL; return NULL;