]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Fix some more bugs (coverity you're a life saver)
authorDale Weiler <killfieldengine@gmail.com>
Sat, 22 Jun 2013 02:05:04 +0000 (02:05 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Sat, 22 Jun 2013 02:05:04 +0000 (02:05 +0000)
ir.c
util.c

diff --git a/ir.c b/ir.c
index 3fe990851f6a1dd5cb95931b03d2208c4e354980..65670c924dd52c0152d0bfa4f22a21225cdadfce 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -3910,7 +3910,7 @@ void ir_instr_dump(ir_instr *in, char *ind,
         return;
     }
 
-    strncat(ind, "\t", IND_BUFSZ);
+    strncat(ind, "\t", IND_BUFSZ-1);
 
     if (in->_ops[0] && (in->_ops[1] || in->_ops[2])) {
         ir_value_dump(in->_ops[0], oprintf);
diff --git a/util.c b/util.c
index 15ccd25e90ef56620f31170d0e3f5e62b87e1444..3cdc1dbed6e875b8af1e715a652994ba6805e4c6 100644 (file)
--- a/util.c
+++ b/util.c
@@ -440,7 +440,7 @@ static GMQCC_INLINE void mt_generate(void) {
      * = 2*2*3*3*11])
      */
     i = MT_SPACE;
-    while (i < MT_SIZE - 1) {
+    while (i < MT_SIZE-2) {
         /*
          * We expand this 11 times .. manually, no macros are required
          * here. This all fits in the CPU cache.