util: drop the stpcpy gnulib module

stpcpy returns a pointer to the end of the string just copied
which in theory makes it easier to then copy another string
after it. We only use stpcpy in one place though and that
is trivially rewritten to avoid stpcpy with no loss in code
clarity or efficiency.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2019-10-02 16:14:45 +01:00
parent a45fa8000a
commit cc7cc5b092
2 changed files with 3 additions and 3 deletions

View File

@ -96,7 +96,6 @@ snprintf
socket
stat-time
stdarg
stpcpy
strchrnul
strdup-posix
strndup

View File

@ -1367,8 +1367,9 @@ void virReportSystemErrorFull(int domcode,
size_t len = strlen(errnoDetail);
if (0 <= n && n + 2 + len < sizeof(msgDetailBuf)) {
char *p = msgDetailBuf + n;
stpcpy(stpcpy(p, ": "), errnoDetail);
strcpy(msgDetailBuf + n, ": ");
n += 2;
strcpy(msgDetailBuf + n, errnoDetail);
msgDetail = msgDetailBuf;
}
}