* breakpoint.c, breakpoint.h (breakpoint_init_inferior): New function
[deliverable/binutils-gdb.git] / gdb / c-lang.c
index bfa03d0a590f080a4358f295a1b3e2d38f867c0d..ea0795915f5622685ea893a332728b8f93c6e76d 100644 (file)
@@ -111,7 +111,7 @@ c_printstr (stream, string, length, force_ellipses)
   /* If the string was not truncated due to `set print elements', and
      the last byte of it is a null, we don't print that, in traditional C
      style.  */
-  if ((!force_ellipses) && string[length-1] == '\0')
+  if ((!force_ellipses) && length > 0 && string[length-1] == '\0')
     length--;
 
   if (length == 0)
@@ -408,9 +408,9 @@ const struct language_defn c_language_defn = {
   &BUILTIN_TYPE_UNSIGNED_LONGEST,/* longest unsigned integral type */
   &builtin_type_double,                /* longest floating point type */ /*FIXME*/
   {"",     "",    "",  ""},    /* Binary format info */
-  {"0%o",  "0",   "o", ""},    /* Octal format info */
-  {"%d",   "",    "d", ""},    /* Decimal format info */
-  {"0x%x", "0x",  "x", ""},    /* Hex format info */
+  {"0%lo",  "0",   "o", ""},   /* Octal format info */
+  {"%ld",   "",    "d", ""},   /* Decimal format info */
+  {"0x%lx", "0x",  "x", ""},   /* Hex format info */
   c_op_print_tab,              /* expression operators for printing */
   LANG_MAGIC
 };
@@ -432,9 +432,9 @@ const struct language_defn cplus_language_defn = {
   &BUILTIN_TYPE_UNSIGNED_LONGEST,/* longest unsigned integral type */
   &builtin_type_double,                /* longest floating point type */ /*FIXME*/
   {"",      "",    "",   ""},  /* Binary format info */
-  {"0%o",   "0",   "o",  ""},  /* Octal format info */
-  {"%d",    "",    "d",  ""},  /* Decimal format info */
-  {"0x%x",  "0x",  "x",  ""},  /* Hex format info */
+  {"0%lo",   "0",   "o",  ""}, /* Octal format info */
+  {"%ld",    "",    "d",  ""}, /* Decimal format info */
+  {"0x%lx",  "0x",  "x",  ""}, /* Hex format info */
   c_op_print_tab,              /* expression operators for printing */
   LANG_MAGIC
 };
This page took 0.023346 seconds and 4 git commands to generate.