]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Fix CRC16
authorDale Weiler <killfieldengine@gmail.com>
Mon, 25 Nov 2013 07:11:45 +0000 (02:11 -0500)
committerDale Weiler <killfieldengine@gmail.com>
Mon, 25 Nov 2013 07:11:45 +0000 (02:11 -0500)
intrin.c
util.c

index a6d35209e00ca128a07ec69da28825d54255112b..c9cbfed383ced19f76d9f30635f2065bd9dde346 100644 (file)
--- a/intrin.c
+++ b/intrin.c
@@ -860,6 +860,7 @@ static ast_expression *intrin_pow(intrin_t *intrin) {
             (ast_expression*)intrin->fold->imm_float[1]
         )
     );
+
     vec_push(body->exprs,
         (ast_expression*)ast_store_new(
             intrin_ctx(intrin),
@@ -868,6 +869,7 @@ static ast_expression *intrin_pow(intrin_t *intrin) {
             (ast_expression*)callsqrt1
         )
     );
+
     vec_push(body->exprs,
         (ast_expression*)ast_store_new(
             intrin_ctx(intrin),
diff --git a/util.c b/util.c
index 4300d3c3d900b2b9545ee31b5ff86588f0fd7308..e9d4cfeb4b55e2263839f1290116885a2a9781ba 100644 (file)
--- a/util.c
+++ b/util.c
@@ -482,6 +482,7 @@ uint16_t util_crc16(uint16_t current, const char *GMQCC_RESTRICT k, size_t len)
             SELECT_DATA(1) ^
             SELECT_DATA(0);
         data += 8;
+        len  -= 8;
     }
 
     #undef SELECT_BULK