X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmarcmap.c;h=f79b3232a123349fc6b1fc5c549680f0348e24b5;hb=HEAD;hp=b10b464f12a48675fb079565ef6fb83f27dc31ec;hpb=8961ed761e348e972f00d015284ce75c16b1648c;p=pazpar2-moved-to-github.git diff --git a/src/marcmap.c b/src/marcmap.c index b10b464..f79b323 100644 --- a/src/marcmap.c +++ b/src/marcmap.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2012 Index Data + Copyright (C) Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -42,7 +42,7 @@ struct marcmap *marcmap_load(const char *filename, NMEM nmem) struct marcmap *mm; struct marcmap *mmhead; FILE *fp; - char c; + int c; char buf[256]; int len; int field; @@ -54,6 +54,8 @@ struct marcmap *marcmap_load(const char *filename, NMEM nmem) mm = NULL; mmhead = NULL; fp = fopen(filename, "r"); + if (!fp) + return mmhead; while ((c = getc(fp) ) != EOF) {