Skip to content

Commit

Permalink
#2216 Skip the leading spaces for the station_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Soh committed Sep 15, 2022
1 parent 55eab4f commit ef08055
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/basic/vx_util/observation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ Observation::Observation(const string &header_type, const string &station_id,
_value(value)
{

std::replace(_stationId.begin(), _stationId.end(), ' ', '_');
string::iterator it = _stationId.begin();
while (' ' == *it) it++; // skip leading spaces
std::replace(it, _stationId.end(), ' ', '_');

}

Expand Down

0 comments on commit ef08055

Please sign in to comment.