X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=common.c;h=8ea52fa6d7b5398d2ff4a1c90cd9faa10ca410a7;hb=refs%2Ftags%2Fv3.1.7;hp=ed39b87148f6c726178f206f460c39c39975c56f;hpb=90f8c88626289b0a713abc41759e8bebe6c20ddb;p=pciutils.git diff --git a/common.c b/common.c index ed39b87..8ea52fa 100644 --- a/common.c +++ b/common.c @@ -44,6 +44,15 @@ xrealloc(void *ptr, unsigned int howmuch) return p; } +char * +xstrdup(char *str) +{ + int len = strlen(str) + 1; + char *copy = xmalloc(len); + memcpy(copy, str, len); + return copy; +} + static void set_pci_method(struct pci_access *pacc, char *arg) {