diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-05-02 02:15:06 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-05-02 02:15:06 +0000 |
commit | 059f2702668ecae55f8887bccadc24ffe6ca639b (patch) | |
tree | e8b8cc472e129d4049c767e35150456ad7a6b671 /usr.bin | |
parent | b152d5fbb5c19a734918705720935da121992010 (diff) | |
download | FreeBSD-src-059f2702668ecae55f8887bccadc24ffe6ca639b.zip FreeBSD-src-059f2702668ecae55f8887bccadc24ffe6ca639b.tar.gz |
*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.
Diffstat (limited to 'usr.bin')
-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 bb8b20e..6baa3f0 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; |