mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-06 11:36:51 +03:00
Remove newline in version (#1891)
* remove newline in version * . * . Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
@@ -15,6 +15,7 @@ extern "C"
|
||||
#include <string.h>
|
||||
#include "Helper.h"
|
||||
#include <fstream>
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
const char* build_time(void)
|
||||
@@ -63,7 +64,10 @@ std::string getHTMLversion(void){
|
||||
fgets(buf, sizeof(buf), pFile); // Line 1: Version
|
||||
fclose(pFile);
|
||||
|
||||
return std::string(buf);
|
||||
string value = string(buf);
|
||||
value.erase(std::remove(value.begin(), value.end(), '\n'), value.end()); // Remove any newlines
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
std::string getHTMLcommit(void){
|
||||
@@ -79,7 +83,10 @@ std::string getHTMLcommit(void){
|
||||
fgets(buf, sizeof(buf), pFile); // Line 2: Commit
|
||||
fclose(pFile);
|
||||
|
||||
return std::string(buf);
|
||||
string value = string(buf);
|
||||
value.erase(std::remove(value.begin(), value.end(), '\n'), value.end()); // Remove any newlines
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
#endif // _VERSION_H
|
||||
Reference in New Issue
Block a user