remove ending whitespaces from string fields
This commit is contained in:
@@ -237,7 +237,7 @@ public:
|
|||||||
char j = intel ? 0 : 24;
|
char j = intel ? 0 : 24;
|
||||||
char j_m = intel ? -8 : 8;
|
char j_m = intel ? -8 : 8;
|
||||||
for (unsigned i=0; i<num_components; ++i, j -= j_m)
|
for (unsigned i=0; i<num_components; ++i, j -= j_m)
|
||||||
value[i] = data >> j & 0xff;
|
value[i] = (data >> j) & 0xff;
|
||||||
if (value[num_components-1] == '\0')
|
if (value[num_components-1] == '\0')
|
||||||
value.resize(num_components-1);
|
value.resize(num_components-1);
|
||||||
} else
|
} else
|
||||||
@@ -246,6 +246,8 @@ public:
|
|||||||
unsigned num(0);
|
unsigned num(0);
|
||||||
while (num < num_components && sz[num] != '\0')
|
while (num < num_components && sz[num] != '\0')
|
||||||
++num;
|
++num;
|
||||||
|
while (num && sz[num-1] == ' ')
|
||||||
|
--num;
|
||||||
value.assign(sz, num);
|
value.assign(sz, num);
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
Reference in New Issue
Block a user