diff options
Diffstat (limited to 'src/melon.c')
-rw-r--r-- | src/melon.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/melon.c b/src/melon.c index 62b742d..375cf09 100644 --- a/src/melon.c +++ b/src/melon.c @@ -86,25 +86,25 @@ main(int argc, char **argv, char **envp) cnki_info(¶m); - if (strcmp(param->file_stat->type, "%PDF") == 0) { + if (strncmp(param->file_stat->type, "%PDF", 4) == 0) { if (cnki_pdf(¶m) != 0) { fprintf(stderr, "%s: %s\n", argv[0], strerror(errno)); return EXIT_FAILURE; } - } else if (strcmp(param->file_stat->type, "CAJ") == 0) { + } else if (strncmp(param->file_stat->type, "CAJ", 3) == 0) { if (cnki_caj(¶m) != 0) { fprintf(stderr, "%s: %s\n", argv[0], strerror(errno)); return EXIT_FAILURE; } - } else if (strcmp(param->file_stat->type, "HN") == 0) { + } else if (strncmp(param->file_stat->type, "HN", 2) == 0) { if (cnki_hn(¶m) != 0) { fprintf(stderr, "%s: %s\n", argv[0], strerror(errno)); return EXIT_FAILURE; } - } else if (strcmp(param->file_stat->type, "KDH ") == 0) { + } else if (strncmp(param->file_stat->type, "KDH ", 4) == 0) { if (cnki_kdh(¶m) != 0) { fprintf(stderr, "%s: %s\n", argv[0], strerror(errno)); |