From: Wolfgang (Blub) Bumiller <blub@speed.at>
Date: Fri, 30 Nov 2012 14:20:23 +0000 (+0100)
Subject: Don't try to compile an empty output from the preprocessor
X-Git-Tag: 0.1.9~177
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=645bd212d7095bed4e96c573fb68cd46d16843cb;p=xonotic%2Fgmqcc.git

Don't try to compile an empty output from the preprocessor
---

diff --git a/main.c b/main.c
index 9d9c5f3..1d84ae9 100644
--- a/main.c
+++ b/main.c
@@ -655,9 +655,11 @@ srcdone:
                         goto cleanup;
                     }
                     data = ftepp_get();
-                    if (!parser_compile_string_len(items[itr].filename, data, vec_size(data)-1)) {
-                        retval = 1;
-                        goto cleanup;
+                    if (vec_size(data)) {
+                        if (!parser_compile_string_len(items[itr].filename, data, vec_size(data))) {
+                            retval = 1;
+                            goto cleanup;
+                        }
                     }
                     ftepp_flush();
                 }