diff options
author | Petr Machata <pmachata@redhat.com> | 2013-11-06 11:59:59 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2013-11-06 12:12:57 +0100 |
commit | b5c837f545342b6017fe6ec7aa60c1fc866fde06 (patch) | |
tree | 73d14ebf9a9aff23889e064e28851cc66f91386e /prototype.c | |
parent | 89396203c9de0d60374e1b298529afcf0bfbf5ed (diff) | |
download | ltrace-b5c837f545342b6017fe6ec7aa60c1fc866fde06.tar.gz |
Replace a chain of stpcpy's with a sprintf
- That's clearer and doesn't require _POSIX_SOURCE defines (that are
missing anyway)
Diffstat (limited to 'prototype.c')
-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); } |