]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - main.c
out-of-bounds indexing check on static array indexing
[xonotic/gmqcc.git] / main.c
diff --git a/main.c b/main.c
index db9f2b81806b848826b985d329a0ab770e8cc82b..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();
                 }
@@ -686,6 +688,14 @@ srcdone:
 
     /* stuff */
 
+    if (!opts_pp_only) {
+        for (itr = 0; itr < COUNT_OPTIMIZATIONS; ++itr) {
+            if (optimization_count[itr]) {
+                con_out("%s: %u\n", opts_opt_list[itr].name, (unsigned int)optimization_count[itr]);
+            }
+        }
+    }
+
 cleanup:
     util_debug("COM", "cleaning ...\n");
     ftepp_finish();