Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

Commit

Permalink
Adding zero padding to SN etc
Browse files Browse the repository at this point in the history
  • Loading branch information
dgastler committed Sep 17, 2020
1 parent 2c6b2d5 commit 3268c36
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ApolloMonitor/ApolloMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,19 @@ static std::string ReplaceInString(std::string original,

void ApolloMonitor::ReplaceSN(std::string & original){
char buffer[20];
snprintf(buffer,20,"%d",SM->GetSerialNumber());
snprintf(buffer,20,"%02d",SM->GetSerialNumber());
original = ReplaceInString(original,"$SN",buffer);
}

void ApolloMonitor::ReplaceRN(std::string & original){
char buffer[20];
snprintf(buffer,20,"%d",SM->GetRevNumber());
snprintf(buffer,20,"%02d",SM->GetRevNumber());
original = ReplaceInString(original,"$RN",buffer);
}

void ApolloMonitor::ReplaceShelfID(std::string & original){
char buffer[20];
snprintf(buffer,20,"%d",SM->GetShelfID());
snprintf(buffer,20,"%02d",SM->GetShelfID());
original = ReplaceInString(original,"$SHELF_ID",buffer);
}

Expand Down

0 comments on commit 3268c36

Please sign in to comment.