diff options
author | Tom Tromey <tom@tromey.com> | 2021-12-11 15:10:14 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-12-20 08:49:27 -0700 |
commit | dde238e063376f96d52ff27f11b31a447ddbdfea (patch) | |
tree | 12d55ab85c592669dd02d14817f247bea49dc718 /gdb/utils.h | |
parent | db956d66c94de1bc1ff9ac1c38350f14e81c11f6 (diff) | |
download | gdb-dde238e063376f96d52ff27f11b31a447ddbdfea.zip gdb-dde238e063376f96d52ff27f11b31a447ddbdfea.tar.gz gdb-dde238e063376f96d52ff27f11b31a447ddbdfea.tar.bz2 |
Make n_spaces return a const char *
n_spaces keeps the spaces in a static buffer. If a caller overwrites
these, it may give an incorrect result to a subsequent caller. So,
make the return type const to help avoid this outcome.
Diffstat (limited to 'gdb/utils.h')
-rw-r--r-- | gdb/utils.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/utils.h b/gdb/utils.h index 6f3a702..f6fd32f 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -473,7 +473,7 @@ extern void print_spaces (int, struct ui_file *); extern void print_spaces_filtered (int, struct ui_file *); -extern char *n_spaces (int); +extern const char *n_spaces (int); extern void fputstr_filtered (const char *str, int quotr, struct ui_file * stream); |