Start packet mmap work
[babeltrace.git] / types / string.c
index f8778c845052709464f110cba1099ab662ce2e59..796f05cd6a47f555c2584993d89956b9479adf02 100644 (file)
@@ -35,13 +35,14 @@ void string_copy(struct stream_pos *dest, const struct format *fdest,
                container_of(definition, struct definition_string, p);
        struct declaration_string *string_declaration = string->declaration;
 
-       if (fsrc->string_copy == fdest->string_copy) {
+       if (fdest && (fsrc->string_copy == fdest->string_copy)) {
                fsrc->string_copy(dest, src, string_declaration);
        } else {
                char *tmp = NULL;
 
                fsrc->string_read(&tmp, src, string_declaration);
-               fdest->string_write(dest, tmp, string_declaration);
+               if (fdest)
+                       fdest->string_write(dest, tmp, string_declaration);
                fsrc->string_free_temp(tmp);
        }
 }
This page took 0.02379 seconds and 4 git commands to generate.