summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-05-22 13:41:08 +0000
committerjmallett <jmallett@FreeBSD.org>2002-05-22 13:41:08 +0000
commit199da7245abeaeca11ef17e71e7b34fbb2a8a5e4 (patch)
tree2b8d8f340dac9485f5dae7217c65b9c47419a886 /usr.bin
parent06e51352f65b610b20d2a1bdcbd45af0b1eed12a (diff)
downloadFreeBSD-src-199da7245abeaeca11ef17e71e7b34fbb2a8a5e4.zip
FreeBSD-src-199da7245abeaeca11ef17e71e7b34fbb2a8a5e4.tar.gz
Make the guarded string functions take a const "from" addr, and make the
function that prints when a botched guarded string operation occurs take two const arguments. XXX Should we use strlcat/strlcpy instead and hope for the best?
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/sccs/sccs.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/sccs/sccs.c b/usr.bin/sccs/sccs.c
index 48d3e93..1950649 100644
--- a/usr.bin/sccs/sccs.c
+++ b/usr.bin/sccs/sccs.c
@@ -291,10 +291,10 @@ char *username(void);
bool unedit(char *);
int usrerr(const char *, ...);
-void gstrbotch(char *, char *);
-char *gstrcat(char *, char *, size_t);
-char *gstrcpy(char *, char *, size_t);
-char *gstrncat(char *, char *, size_t, size_t);
+void gstrbotch(const char *, const char *);
+char *gstrcat(char *, const char *, size_t);
+char *gstrcpy(char *, const char *, size_t);
+char *gstrncat(char *, const char *, size_t, size_t);
#define FBUFSIZ BUFSIZ
#define PFILELG 120
@@ -1571,7 +1571,7 @@ username(void)
** is to be done.
*/
char *
-gstrcat(char *to, char *from, size_t length)
+gstrcat(char *to, const char *from, size_t length)
{
if (strlen(from) + strlen(to) >= length) {
gstrbotch(to, from);
@@ -1580,7 +1580,7 @@ gstrcat(char *to, char *from, size_t length)
}
char *
-gstrncat(char *to, char *from, size_t n, size_t length)
+gstrncat(char *to, const char *from, size_t n, size_t length)
{
if (n + strlen(to) >= length) {
gstrbotch(to, from);
@@ -1589,7 +1589,7 @@ gstrncat(char *to, char *from, size_t n, size_t length)
}
char *
-gstrcpy(char *to, char *from, size_t length)
+gstrcpy(char *to, const char *from, size_t length)
{
if (strlen(from) >= length) {
gstrbotch(from, (char *)0);
@@ -1598,7 +1598,7 @@ gstrcpy(char *to, char *from, size_t length)
}
void
-gstrbotch(char *str1, char *str2)
+gstrbotch(const char *str1, const char *str2)
{
usrerr("Filename(s) too long: %s %s", str1, str2);
}
OpenPOWER on IntegriCloud