Don't write to inferior_ptid in linux_get_siginfo_data
[deliverable/binutils-gdb.git] / sim / common / sim-utils.c
index e83a2e4d0c83206b7f3a3d70fefd11c7c5191619..d420f55d5150f0247c4ac20b0f598a9d8bfd5e31 100644 (file)
@@ -1,5 +1,5 @@
 /* Miscellaneous simulator utilities.
-   Copyright (C) 1997-2019 Free Software Foundation, Inc.
+   Copyright (C) 1997-2020 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
 This file is part of GDB, the GNU debugger.
@@ -355,8 +355,8 @@ map_to_str (unsigned map)
     case io_map: return "io";
     default:
       {
-       static char str[10];
-       sprintf (str, "(%ld)", (long) map);
+       static char str[16];
+       snprintf (str, sizeof(str), "(%ld)", (long) map);
        return str;
       }
     }
@@ -385,8 +385,8 @@ access_to_str (unsigned access)
     case access_read_write_exec_io: return "read_write_exec_io";
     default:
       {
-       static char str[10];
-       sprintf (str, "(%ld)", (long) access);
+       static char str[16];
+       snprintf (str, sizeof(str), "(%ld)", (long) access);
        return str;
       }
     }
This page took 0.047544 seconds and 4 git commands to generate.