From 9836f991723cbd0c3cbebe6e5031a21c7716d3aa Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 3 May 2024 16:24:52 +0200 Subject: [PATCH] ImStrv: allow constructing from two null pointers. --- imgui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.h b/imgui.h index ff389f08d..4f050cf22 100644 --- a/imgui.h +++ b/imgui.h @@ -343,7 +343,7 @@ struct ImStrv const char* End; ImStrv() { Begin = End = NULL; } ImStrv(const char* b) { Begin = b; End = b ? b + strlen(b) : NULL; } - ImStrv(const char* b, const char* e){ Begin = b; End = e ? e : b + strlen(b); } + ImStrv(const char* b, const char* e){ Begin = b; End = e ? e : b ? b + strlen(b) : NULL; } inline size_t length() const { return (size_t)(End - Begin); } inline bool empty() const { return Begin == End; } // == "" or == NULL inline operator bool() const { return Begin != NULL; } // return true when valid ("" is valid, NULL construction is not)