diff --git a/vmur/Makefile b/vmur/Makefile index f48bbf3e..dd6799dd 100644 --- a/vmur/Makefile +++ b/vmur/Makefile @@ -5,7 +5,9 @@ LDLIBS += -lz all: vmur -libs = $(rootdir)/libvmdump/libvmdump.a +libs = $(rootdir)/libvmdump/libvmdump.a \ + $(rootdir)/libutil/libutil.a + objects = vmur.o vmur: $(objects) $(libs) diff --git a/vmur/vmur.cpp b/vmur/vmur.cpp index 9529717d..b2bc5231 100644 --- a/vmur/vmur.cpp +++ b/vmur/vmur.cpp @@ -31,6 +31,7 @@ #include "lib/vmdump.h" #include "lib/zt_common.h" +#include "lib/util_str.h" #include "vmur.h" @@ -1369,30 +1370,6 @@ static void close_reader(struct vmur *info, const char *hold) cpcmd(cmd, NULL, NULL, 0); } -/* - * strip leading and trailing blanks - */ -static char *strstrip(char *s) -{ - size_t size; - char *end; - - size = strlen(s); - - if (!size) - return s; - - end = s + size - 1; - while (end >= s && isspace(*end)) - end--; - *(end + 1) = '\0'; - - while (*s && isspace(*s)) - s++; - - return s; -} - /* * Check whether reader can handle class of reader spool file */ @@ -1431,9 +1408,9 @@ static int get_filename_from_reader(struct vmur *info) sprintf(cmd, "QUERY RDR * %s ALL SHORTDATE", info->spoolid); cpcmd(cmd, &buf, NULL, 0); memcpy(name, &buf[130], 8); - strstrip(name); + util_strstrip(name); memcpy(type, &buf[140], 8); - strstrip(type); + util_strstrip(type); free(buf); if (strlen(name) == 0) { ERR("Please specify name to receive "