]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Don't try to compile an empty output from the preprocessor
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 14:20:23 +0000 (15:20 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 14:20:23 +0000 (15:20 +0100)
main.c

diff --git a/main.c b/main.c
index 9d9c5f3cf2d25182626d895c1624058a2efeb7e1..1d84ae94222aa904d76578aeb1e3468efee44ab0 100644 (file)
--- 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();
                 }