aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/xargs/strnsubst.c
diff options
context:
space:
mode:
authorJuli Mallett <jmallett@FreeBSD.org>2002-05-02 02:15:06 +0000
committerJuli Mallett <jmallett@FreeBSD.org>2002-05-02 02:15:06 +0000
commit299ea75ab74646674c882badc6cb19f106752f4a (patch)
treee8b8cc472e129d4049c767e35150456ad7a6b671 /usr.bin/xargs/strnsubst.c
parent639c9550fb346921350cd3badad4545d92d09c25 (diff)
downloadsrc-299ea75ab74646674c882badc6cb19f106752f4a.tar.gz
src-299ea75ab74646674c882badc6cb19f106752f4a.zip
*str is spelled 's1' inside the body of the code.
Make 'this' not a local variable, since it isn't necessary or complex enough to warrant such.
Notes
Notes: svn path=/head/; revision=95900
Diffstat (limited to 'usr.bin/xargs/strnsubst.c')
-rw-r--r--usr.bin/xargs/strnsubst.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/xargs/strnsubst.c b/usr.bin/xargs/strnsubst.c
index bb8b20e193a5..6baa3f0df704 100644
--- a/usr.bin/xargs/strnsubst.c
+++ b/usr.bin/xargs/strnsubst.c
@@ -29,7 +29,7 @@ void strnsubst(char **, const char *, const char *, size_t);
void
strnsubst(char **str, const char *match, const char *replstr, size_t maxsize)
{
- char *s1, *s2;
+ char *s1, *s2, *this;
s1 = *str;
if (s1 == NULL)
@@ -38,14 +38,12 @@ strnsubst(char **str, const char *match, const char *replstr, size_t maxsize)
if (s2 == NULL)
err(1, "calloc");
- if (match == NULL || replstr == NULL || maxsize == strlen(*str)) {
+ if (match == NULL || replstr == NULL || maxsize == strlen(s1)) {
strlcpy(s2, s1, maxsize);
goto done;
}
for (;;) {
- char *this;
-
this = strstr(s1, match);
if (this == NULL)
break;