From f1706486299af72505bce4d13d94d80571dd1829 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Tue, 3 Dec 2019 18:23:14 +0000 Subject: [PATCH] Fix issue with `-thread-count` flag with <= 0 count --- core/strconv/generic_float.odin | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/strconv/generic_float.odin b/core/strconv/generic_float.odin index 536b03742..e4784a2e5 100644 --- a/core/strconv/generic_float.odin +++ b/core/strconv/generic_float.odin @@ -56,7 +56,7 @@ generic_ftoa :: proc(buf: []byte, val: f64, fmt: byte, precision, bit_size: int) } else { s = "+Inf"; } - n := copy(buf, transmute([]byte)s); + n := copy(buf, s); return buf[:n]; case 0: // denormalized diff --git a/src/main.cpp b/src/main.cpp index fc6dab911..3cb33037e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -483,7 +483,7 @@ bool parse_build_flags(Array args) { isize count = cast(isize)big_int_to_i64(&value.value_integer); if (count <= 0) { gb_printf_err("%.*s expected a positive non-zero number, got %.*s\n", LIT(name), LIT(param)); - build_context.thread_count = 0; + build_context.thread_count = 1; } else { build_context.thread_count = count; }