aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2017-06-07 11:41:39 +0200
committerAlexey Kardashevskiy <aik@ozlabs.ru>2017-06-08 16:09:07 +1000
commit1f0600f25d64ced53d69347871c209bde8bb2a3c (patch)
treedce2918e56e10b9a4fc897b8767030fc434c8c4d /lib
parent9d5d3b8bd256ac701b0ac0c4059a2b77b6f15912 (diff)
downloadSLOF-1f0600f25d64ced53d69347871c209bde8bb2a3c.zip
SLOF-1f0600f25d64ced53d69347871c209bde8bb2a3c.tar.gz
SLOF-1f0600f25d64ced53d69347871c209bde8bb2a3c.tar.bz2
libc: The arguments of puts() can be marked as "const"
puts() does not change the string, so the parameter can be "const". Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/include/stdio.h2
-rw-r--r--lib/libc/stdio/puts.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/include/stdio.h b/lib/libc/include/stdio.h
index 84cddea..c54528f 100644
--- a/lib/libc/include/stdio.h
+++ b/lib/libc/include/stdio.h
@@ -51,7 +51,7 @@ int setvbuf(FILE *stream, char *buf, int mode , size_t size);
int putc(int ch, FILE *stream);
int putchar(int ch);
-int puts(char *str);
+int puts(const char *str);
int scanf(const char *format, ...) __attribute__((format (scanf, 1, 2)));
int fscanf(FILE *stream, const char *format, ...) __attribute__((format (scanf, 2, 3)));
diff --git a/lib/libc/stdio/puts.c b/lib/libc/stdio/puts.c
index 3f48dbf..9a93008 100644
--- a/lib/libc/stdio/puts.c
+++ b/lib/libc/stdio/puts.c
@@ -17,7 +17,7 @@
int
-puts(char *str)
+puts(const char *str)
{
int ret;