Skip to content

Commit 622a8b7

Browse files
committed
ImStrv: allow constructing from two null pointers.
1 parent 1829b4c commit 622a8b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

imgui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ struct ImStrv
326326
const char* End;
327327
ImStrv() { Begin = End = NULL; }
328328
ImStrv(const char* b) { Begin = b; End = b ? b + strlen(b) : NULL; }
329-
ImStrv(const char* b, const char* e){ Begin = b; End = e ? e : b + strlen(b); }
329+
ImStrv(const char* b, const char* e){ Begin = b; End = e ? e : b ? b + strlen(b) : NULL; }
330330
inline size_t length() const { return (size_t)(End - Begin); }
331331
inline bool empty() const { return Begin == End; } // == "" or == NULL
332332
inline operator bool() const { return Begin != NULL; } // return true when valid ("" is valid, NULL construction is not)

0 commit comments

Comments
 (0)