diff options
author | Petr Machata <pmachata@redhat.com> | 2013-11-06 11:59:59 +0100 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-08-22 20:38:23 +0900 |
commit | 23040c1b38cbc4488dd1c9877b3195b43c6fd0e0 (patch) | |
tree | 73d14ebf9a9aff23889e064e28851cc66f91386e | |
parent | 5f8af20d2d2ec66efcb2e1eb7b0749694de6bcda (diff) | |
download | ltrace-23040c1b38cbc4488dd1c9877b3195b43c6fd0e0.tar.gz ltrace-23040c1b38cbc4488dd1c9877b3195b43c6fd0e0.tar.bz2 ltrace-23040c1b38cbc4488dd1c9877b3195b43c6fd0e0.zip |
Replace a chain of stpcpy's with a sprintf
- That's clearer and doesn't require _POSIX_SOURCE defines (that are
missing anyway)
-rw-r--r-- | prototype.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/prototype.c b/prototype.c index a892666..fa52ff3 100644 --- a/prototype.c +++ b/prototype.c @@ -342,9 +342,8 @@ consider_config_dir(struct protolib_cache *cache, const char *path, const char *key) { size_t len = sizeof ".conf"; - char slash[2] = {'/'}; char *buf = alloca(strlen(path) + 1 + strlen(key) + len); - strcpy(stpcpy(stpcpy(stpcpy(buf, path), slash), key), ".conf"); + sprintf(buf, "%s/%s.conf", path, key); return protolib_cache_file(cache, buf, 0); } |