sim-utils.c: prevent buffer overflow.
[deliverable/binutils-gdb.git] / sim / common / sim-utils.c
index e83a2e4d0c83206b7f3a3d70fefd11c7c5191619..0c46662ff3379f15990f65fab4cabc67ce9807d3 100644 (file)
@@ -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.027903 seconds and 4 git commands to generate.