nir/spirv: Use the correct length for copying string literals
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 6 May 2015 19:36:09 +0000 (12:36 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 31 Aug 2015 23:58:20 +0000 (16:58 -0700)
src/glsl/nir/spirv_to_nir.c

index 03ef4c45dd1e13708ca253e47f065657f293c6b0..3d2a26c90b04e0c92a1f80526058ca6edeea7c48 100644 (file)
@@ -57,7 +57,7 @@ static char *
 vtn_string_literal(struct vtn_builder *b, const uint32_t *words,
                    unsigned word_count)
 {
-   return ralloc_strndup(b, (char *)words, (word_count - 2) * sizeof(*words));
+   return ralloc_strndup(b, (char *)words, word_count * sizeof(*words));
 }
 
 static const uint32_t *