fix(crash): overflowing the stack

This commit is contained in:
Songtronix 2019-10-18 12:03:01 +02:00
parent fe4a61354a
commit fffffff536
6 changed files with 19 additions and 19 deletions

View File

@ -82,8 +82,8 @@ impl Client {
"Server is running {}[{}], you are running {}[{}], versions might be incompatible!",
server_info.git_hash,
server_info.git_date,
common::util::GIT_HASH,
common::util::GIT_DATE,
common::util::GIT_HASH.to_string(),
common::util::GIT_DATE.to_string(),
);
}

View File

@ -13,7 +13,7 @@ fn main() {
"log",
"-n",
"1",
"--pretty=format:%h %cd",
"--pretty=format:%h/%cd",
"--date=format:%Y-%m-%d-%H:%M",
])
.output()

View File

@ -5,18 +5,6 @@ lazy_static::lazy_static! {
pub static ref GIT_DATE: &'static str = include_str!(concat!(env!("OUT_DIR"), "/githash")).split(" ").nth(1).unwrap();
}
impl std::fmt::Display for GIT_HASH {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.to_string())
}
}
impl std::fmt::Display for GIT_DATE {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.to_string())
}
}
use vek::{Mat3, Rgb, Rgba, Vec3};
/// This is a fast approximation of powf. This should only be used when minor accuracy loss is acceptable.

View File

@ -452,7 +452,11 @@ impl Hud {
let mut events = Vec::new();
let (ref mut ui_widgets, ref mut tooltip_manager) = self.ui.set_widgets();
let version = format!("{}-{}", env!("CARGO_PKG_VERSION"), common::util::GIT_HASH);
let version = format!(
"{}-{}",
env!("CARGO_PKG_VERSION"),
common::util::GIT_VERSION.to_string()
);
if self.show.ingame {
// Crosshair

View File

@ -288,7 +288,11 @@ impl CharSelectionUi {
fn update_layout(&mut self, client: &Client) -> Vec<Event> {
let mut events = Vec::new();
let (ref mut ui_widgets, ref mut tooltip_manager) = self.ui.set_widgets();
let version = env!("CARGO_PKG_VERSION");
let version = format!(
"{}-{}",
env!("CARGO_PKG_VERSION"),
common::util::GIT_VERSION.to_string()
);
// Tooltip
let tooltip_human = Tooltip::new({
// Edge images [t, b, r, l]
@ -469,7 +473,7 @@ impl CharSelectionUi {
}
// Alpha Version
Text::new(version)
Text::new(&version)
.top_right_with_margins_on(ui_widgets.window, 5.0, 5.0)
.font_size(14)
.font_id(self.fonts.cyri)

View File

@ -179,7 +179,11 @@ impl MainMenuUi {
fn update_layout(&mut self, global_state: &mut GlobalState) -> Vec<Event> {
let mut events = Vec::new();
let (ref mut ui_widgets, ref mut _tooltip_manager) = self.ui.set_widgets();
let version = format!("{}-{}/{}", env!("CARGO_PKG_VERSION"), common::util::GIT_HASH, common::util::GIT_DATE);
let version = format!(
"{}-{}",
env!("CARGO_PKG_VERSION"),
common::util::GIT_VERSION.to_string()
);
const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0);
const TEXT_COLOR_2: Color = Color::Rgba(1.0, 1.0, 1.0, 0.2);