diff options
author | Juli Mallett <jmallett@FreeBSD.org> | 2002-05-02 02:15:06 +0000 |
---|---|---|
committer | Juli Mallett <jmallett@FreeBSD.org> | 2002-05-02 02:15:06 +0000 |
commit | 299ea75ab74646674c882badc6cb19f106752f4a (patch) | |
tree | e8b8cc472e129d4049c767e35150456ad7a6b671 | |
parent | 639c9550fb346921350cd3badad4545d92d09c25 (diff) | |
download | src-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
-rw-r--r-- | usr.bin/xargs/strnsubst.c | 6 |
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; |