Couple minor fixes for DM_debug_print().
authorNicholas Bishop <nicholasbishop@gmail.com>
Thu, 19 Jan 2012 04:00:27 +0000 (04:00 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Thu, 19 Jan 2012 04:00:27 +0000 (04:00 +0000)
Fix a gcc warning by not using the DM_debug_info string as the format
string, also free the string after printing.

source/blender/blenkernel/intern/DerivedMesh.c

index 344fc485d1a1ddd76a0221dc803a1e0870fc1f50..b670a360a6abb2418b4eae4cfd0f6430d2a25b4e 100644 (file)
@@ -2383,8 +2383,9 @@ char *DM_debug_info(DerivedMesh *dm)
 void DM_debug_print(DerivedMesh *dm)
 {
        char *str = DM_debug_info(dm);
-       printf(str);
+       printf("%s", str);
        fflush(stdout);
+       MEM_freeN(str);
 }
 
 #endif /* NDEBUG */