]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lex.c
Cleanups
[xonotic/gmqcc.git] / lex.c
diff --git a/lex.c b/lex.c
index d7c7b006738ea248219ce7d22e2a24fe0dd55353..7b55dff5033269203a3893804f7a61c89e64b468 100644 (file)
--- a/lex.c
+++ b/lex.c
@@ -52,13 +52,11 @@ struct lex_file *lex_open(FILE *fp) {
        return lex;
 }
 
-int lex_close(struct lex_file *file) {
-       int ret = -1;
-       if (file) {
-               ret = fclose(file->file);
-               mem_d(file);
-       }
-       return ret;
+void lex_close(struct lex_file *file) {
+       if (!file) return;
+       
+       fclose(file->file); /* may already be closed */
+       mem_d(file);
 }
 
 static void lex_addch(int ch, struct lex_file *file) {