]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: drop the stpcpy gnulib module
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 2 Oct 2019 15:14:45 +0000 (16:14 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 7 Oct 2019 10:34:24 +0000 (11:34 +0100)
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>
bootstrap.conf
src/util/virerror.c

index 9964231bb7dabf714255bab592e51aeaae27784b..9ca1e6ddd799d94dda23b3ad7bb7dd4114206336 100644 (file)
@@ -96,7 +96,6 @@ snprintf
 socket
 stat-time
 stdarg
-stpcpy
 strchrnul
 strdup-posix
 strndup
index 77f76a9abf48f4b5133fe505d7602749fa77eeeb..3bb9d1d32c833e6d5eccc277e683392cb3b5087f 100644 (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;
         }
     }