src/output/spv/spv.c (spv_read): Remove unused variable
[pspp] / src / output / spv / spvbin-helpers.c
index e405310395d32f6f835a9f96d38ae78278246276..53ea5d4ac4758de4343a7c79d3890d830c0077a2 100644 (file)
@@ -46,7 +46,7 @@ spvbin_input_to_error (const struct spvbin_input *input, const char *name)
   if (name)
     ds_put_format (&s, "%s: ", name);
   ds_put_cstr (&s, "parse error decoding ");
-  for (size_t i = input->n_errors; i-- > 0; )
+  for (size_t i = input->n_errors; i-- > 0;)
     if (i < SPVBIN_MAX_ERRORS)
       ds_put_format (&s, "/%s@%#zx", input->errors[i].name,
                      input->errors[i].start);
@@ -180,7 +180,8 @@ spvbin_parse_string__ (struct spvbin_input *input,
                        uint32_t (*raw_to_native32) (uint32_t),
                        char **p)
 {
-  *p = NULL;
+  if (p)
+    *p = NULL;
 
   uint32_t length;
   if (input->size - input->ofs < sizeof length)