diff options
author | gad <gad@FreeBSD.org> | 2006-03-08 09:15:20 +0000 |
---|---|---|
committer | gad <gad@FreeBSD.org> | 2006-03-08 09:15:20 +0000 |
commit | 59d0573b934949404abbe2c4473920f8910c8708 (patch) | |
tree | e8789379256521276a1ee3dfdef7fe4404f36538 /bin | |
parent | ec3e08db90b8033da09c5f11061c1546308e2c3b (diff) | |
download | FreeBSD-src-59d0573b934949404abbe2c4473920f8910c8708.zip FreeBSD-src-59d0573b934949404abbe2c4473920f8910c8708.tar.gz |
Collapse strncpy/strncat/strncat into a single snprintf, as suggested
by pjd.
MFC after: 3 weeks
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ps/keyword.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c index a80b8ed3..9ae82c3 100644 --- a/bin/ps/keyword.c +++ b/bin/ps/keyword.c @@ -314,9 +314,7 @@ findvar(char *p, int user, char **header) */ rflen = strlen(v->alias) + strlen(hp) + 2; realfmt = malloc(rflen); - strlcpy(realfmt, v->alias, rflen); - strlcat(realfmt, "=", rflen); - strlcat(realfmt, hp, rflen); + snprintf(realfmt, rflen, "%s=%s", v->alias, hp); parsefmt(realfmt, user); return ((VAR *)NULL); } |