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 socket
stat-time stat-time
stdarg stdarg
stpcpy
strchrnul strchrnul
strdup-posix strdup-posix
strndup strndup

View File

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