From 23040c1b38cbc4488dd1c9877b3195b43c6fd0e0 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Wed, 6 Nov 2013 11:59:59 +0100 Subject: [PATCH] Replace a chain of stpcpy's with a sprintf - That's clearer and doesn't require _POSIX_SOURCE defines (that are missing anyway) --- prototype.c | 3 +-- 1 file changed, 1 insertion(+), 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); } -- 2.7.4