Happy new year
[pazpar2-moved-to-github.git] / src / marcmap.c
index fd9b1be..f79b323 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of Pazpar2.
-   Copyright (C) 2006-2013 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)
     {