mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
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:
parent
a45fa8000a
commit
cc7cc5b092
@ -96,7 +96,6 @@ snprintf
|
|||||||
socket
|
socket
|
||||||
stat-time
|
stat-time
|
||||||
stdarg
|
stdarg
|
||||||
stpcpy
|
|
||||||
strchrnul
|
strchrnul
|
||||||
strdup-posix
|
strdup-posix
|
||||||
strndup
|
strndup
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user