X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=sim%2Fcommon%2Fsim-utils.c;h=d420f55d5150f0247c4ac20b0f598a9d8bfd5e31;hb=41792d688a5a1f158d6e9ecda2b603ae122d69a1;hp=e83a2e4d0c83206b7f3a3d70fefd11c7c5191619;hpb=fd3619828e94a24a92cddec42cbc0ab33352eeb4;p=deliverable%2Fbinutils-gdb.git diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c index e83a2e4d0c..d420f55d51 100644 --- a/sim/common/sim-utils.c +++ b/sim/common/sim-utils.c @@ -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; } }