From 49caa651779a3259f936eca74358ddc1bdd8d4db Mon Sep 17 00:00:00 2001 From: David Siegel Date: Sat, 8 Apr 2023 23:44:53 +0200 Subject: [PATCH] Fix #411 by adding a Value(const char *) constructor. Avoid implicit conversion of pointers to bool. Closes #411. --- tiny_gltf.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tiny_gltf.h b/tiny_gltf.h index e8f6f60..46e3495 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -301,6 +301,9 @@ class Value { } explicit Value(std::string &&s) : type_(STRING_TYPE), string_value_(std::move(s)) {} + explicit Value(const char *s) : type_(STRING_TYPE) { + string_value_ = s; + } explicit Value(const unsigned char *p, size_t n) : type_(BINARY_TYPE) { binary_value_.resize(n); memcpy(binary_value_.data(), p, n);