* ui-file.h (ui_file_xstrdup): Mention that the length argument
[deliverable/binutils-gdb.git] / gdb / python / python-type.c
index e1851121b3bc92b98ff26d4d9d21a37907ed9b2f..f23248c607bc464b2c69f8345ed55145274545bf 100644 (file)
@@ -494,13 +494,13 @@ typy_str (PyObject *self)
 {
   volatile struct gdb_exception except;
   char *thetype = NULL;
+  long length = 0;
   PyObject *result;
 
   TRY_CATCH (except, RETURN_MASK_ALL)
     {
       struct cleanup *old_chain;
       struct ui_file *stb;
-      long length;
 
       stb = mem_fileopen ();
       old_chain = make_cleanup_ui_file_delete (stb);
@@ -516,7 +516,7 @@ typy_str (PyObject *self)
       GDB_PY_HANDLE_EXCEPTION (except);
     }
 
-  result = PyUnicode_Decode (thetype, strlen (thetype), host_charset (), NULL);
+  result = PyUnicode_Decode (thetype, length, host_charset (), NULL);
   xfree (thetype);
 
   return result;
This page took 0.026827 seconds and 4 git commands to generate.