mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
s390-tools: Use util_strstrip in vmur
Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
6a1b9cf10a
commit
811152c08a
@@ -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)
|
||||
|
||||
@@ -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 "
|
||||
|
||||
Reference in New Issue
Block a user